libqmi / Quectel EC21/EC25

Sebastian Sjoholm sebastian.sjoholm at gmail.com
Sat Oct 8 20:03:00 UTC 2016


Hi,

So regarding my issue with Quectel EC21/EC25, I guess most of the times the problem is between the keyboard and the chair, and I guess it was now as well.

When I followed the Quectel documentation on Linux integration I left the raw-ip implementation because linux kernel already have raw-ip support in the kernel, however at the end of that chapter was some crucial changes that I of course did not include. So, after included the changes in “qmi_wwan_bind”, it started to work.

I have included the diff from my changes and the Linux Kernel 4.7.7.

I have only verified EC25, but will soon run EC21 as well.

/drivers/net/usb/qmi_wwan.c
436,451d435
< 
< 	/* Quectel */
< 	if (dev->udev->descriptor.idVendor == cpu_to_le16(0x2C7C)) {
< 		dev_info(&intf->dev, "Quectel EC21&EC25&EC20 R2.0 work on RawIP mode\n");
< 		dev->net->flags |= IFF_NOARP;
< 
< 		usb_control_msg(
< 			interface_to_usbdev(intf),
< 			usb_sndctrlpipe(interface_to_usbdev(intf), 0),
< 			0x22, //USB_CDC_REQ_SET_CONTROL_LINE_STATE
< 			0x21, //USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE
< 			1, //active CDC DTR
< 			intf->cur_altsetting->desc.bInterfaceNumber,
< 			NULL, 0, 100);
< 	}
< 
943,944c927
< 	/* Quectel conflicts with Acer */
< 	/* {QMI_GOBI_DEVICE(0x05c6, 0x9215)},*/	/* Acer Gobi 2000 Modem device (VP413) */
---
> 	{QMI_GOBI_DEVICE(0x05c6, 0x9215)},	/* Acer Gobi 2000 Modem device (VP413) */
946,948d928
< 	{QMI_FIXED_INTF(0x05c6, 0x9003, 4)},    /* Quectel UC20 Mini PCIe */
< 	{QMI_FIXED_INTF(0x2C7C, 0x0125, 4)},    /* Quectel EC25, EC20 R2.0  Mini PCIe */
< 	{QMI_FIXED_INTF(0x2C7C, 0x0121, 4)},    /* Quectel EC21 Mini PCIe */

/drivers/usb/serial/option.c
1164,1166d1163
< 	{ USB_DEVICE(0x05C6, 0x9215) }, /* QUectel EC20 */
< 	{ USB_DEVICE(0x2C7C, 0x0125) }, /* QUectel EC25/EC20 R2.0 */
< 	{ USB_DEVICE(0x2C7C, 0x0121) }, /* QUectel EC21 */
2040d2036
< 	.reset_resume      = usb_wwan_resume, /* Quectel */
2078,2094d2073
< 		return -ENODEV;
< 
< 	/* Quectel UC20 */
< 	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 */
< 	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 EC21, EC25 and EC20 R2.0 */
< 	if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) && 
<             serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)

/drivers/usb/serial/usb_wwan.c
508,520d507
< 	/* Quectel */
< 	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;
< 	}
<


Example from Quectel EC25;

ati
Quectel
EC25
Revision: EC25EFAR02A03M4G
OK

# /usr/bin/qmicli -d /dev/cdc-wdm0 --wds-start-network=lte1.dynamic.com --client-no-release-cid
[/dev/cdc-wdm0] Network started
	Packet data handle: '2267064256'
[/dev/cdc-wdm0] Client ID not released:
	Service: 'wds'
	    CID: '19'
# /usr/bin/qmicli -d /dev/cdc-wdm0 --nas-get-system-info
[/dev/cdc-wdm0] Successfully got system info:
	GSM service:
		Status: 'none'
		True Status: 'none'
		Preferred data path: 'no'
	WCDMA service:
		Status: 'none'
		True Status: 'none'
		Preferred data path: 'no'
	LTE service:
		Status: 'available'
		True Status: 'available'
		Preferred data path: 'no'
		Domain: 'cs-ps'
		Service capability: 'cs-ps'
		Roaming status: 'on'
		Forbidden: 'no'
		Cell ID: '18564097'
		MCC: '235'
		MNC: '96'
		Tracking Area Code: '108'
		Voice support: 'yes'
		eMBMS coverage info support: 'no'
	SIM reject info: 'available'
# /sbin/udhcpc -q -f -S -n -i wwan0
udhcpc (v1.22.1) started
Sending discover...
Sending select for 10.39.8.36...
Lease of 10.39.8.36 obtained, lease time 7200
ip: RTNETLINK answers: File exists
# /sbin/route -v add -host 10.218.245.160 dev wwan0
# ping -c 5 10.218.245.160
PING 10.218.245.160 (10.218.245.160) 56(84) bytes of data.
64 bytes from 10.218.245.160: icmp_seq=1 ttl=62 time=261 ms
64 bytes from 10.218.245.160: icmp_seq=2 ttl=62 time=33.5 ms
64 bytes from 10.218.245.160: icmp_seq=3 ttl=62 time=32.0 ms
64 bytes from 10.218.245.160: icmp_seq=4 ttl=62 time=30.6 ms
64 bytes from 10.218.245.160: icmp_seq=5 ttl=62 time=28.2 ms

--- 10.218.245.160 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 28.204/77.250/261.801/92.292 ms
# /usr/bin/qmicli -d /dev/cdc-wdm0 --wds-stop-network=2267064256 --client-cid=19
Network cancelled... releasing resources
[/dev/cdc-wdm0] Network stopped
#

However, thanks for the support again.

Note, I never got the GobiNet compiled from the Quectel sources, so I could not test that. I prefer the qmi_wwan anyway.

Regards,
Sebastian


>> Have you tried to follow the Quectel instructions and see if that makes
>> it work?  Using GobiNet is probably easiest.  If it works, then
> 
> I have followed the qmi_wwan section, but they have used much earlier qmi_wwan as reference, the raw-ip section they have included I did not add as the raw-ip support should already be included.
> 
>> a comparison of a short probe + one request with the same from qmi_wwan
>> should provide some answers.
>> 
> 
> I will see if I can get the GobiNet to work.
> 
>>> error: couldn't create client for the 'nas' service: CID allocation failed
>>> in the CTL client: Transaction timed out
>> 
>> 
>> The only thing I can think of is that these modems might need the same
>> DTR toggling as the MC7455 etc. If so, then my simple assumption that we
>> could automatically apply this based on USB3 support could be failing.
>> 
>> These modems are based on relatively new Qualcomm chips, but without
>> USB3 support, is that correct?
>> 
> 
> Yes, no USB 3.0 support. The Chipset seems to be 9x07 based.
> 
>> Look for the
>> 
>> 	if (le16_to_cpu(dev->udev->descriptor.bcdUSB) >= 0x0201) {
>> 		qmi_wwan_manage_power(dev, 1);
>> 		qmi_wwan_change_dtr(dev, true);
>> 	}
>> 
>> part and enable that unconditionally.  Does that make a difference?
>> 
> 
> I added this to be active unconditionally, but it did not make any difference.
> 
> -Sebastian
> 



More information about the libqmi-devel mailing list