移远RG200U-CN模组适配问题

移远5G模组RG200U-CN,按照FAE给的驱动修改:

drivers\usb\serial\option.c
drivers\usb\serial\usb_wwan.c

PID和VID已添加,编译内核下载后,重启发现系统里只生成了两个ttyUSB节点:

usb 1-1: new high-speed USB device number 2 using ehci-platform
usb 1-1: USB disconnect, device number 2
usb 1-1: new high-speed USB device number 3 using ehci-platform
cdc_ncm 1-1:1.0: MAC-Address: 2e:e2:9f:8a:3a:a6
cdc_ncm 1-1:1.0 usb0: register 'cdc_ncm' at usb-10040000.ehci-1, CDC NCM, 2e:e2:9f:8a:3a:a6
option 1-1:1.2: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1:1.3: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1

后来经检查option.c代码发现,是在这个函数中,如下代码导致的:

static int option_probe(struct usb_serial *serial,
			const struct usb_device_id *id)
	struct usb_interface_descriptor *iface_desc =
				&serial->interface->cur_altsetting->desc;
	struct usb_device_descriptor *dev_desc = &serial->dev->descriptor;

#if 1 //Added by Quectel
	//Quectel UC20's interface 4 can be used as USB Network device
	if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)
		&& serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
		return -ENODEV;
	//Quectel EC20's interface 4 can be used as USB Network device
	if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)
		&& serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
		return -ENODEV;
	//Quectel EC25&EC21 's interface 4 can be used as USB Network device
	if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)
		&& serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
		return -ENODEV;
#endif			

将这里的
#if 1 改为0,不使用即可,这里判断了接口个数大于4个就会返回失败。

再次编译内核重启,模块识别信息如下:

usb 1-1: new high-speed USB device number 2 using ehci-platform
usb 1-1: USB disconnect, device number 2
usb 1-1: new high-speed USB device number 3 using ehci-platform
cdc_ncm 1-1:1.0: MAC-Address: 36:77:85:76:e5:57
cdc_ncm 1-1:1.0 usb0: register 'cdc_ncm' at usb-10040000.ehci-1, CDC NCM, 36:77:85:76:e5:57
option 1-1:1.2: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1:1.3: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1:1.4: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
option 1-1:1.5: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
option 1-1:1.6: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

fensnote

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

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

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

打赏作者

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

抵扣说明:

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

余额充值