libqmi / Quectel EC21/EC25
Sebastian Sjoholm
sebastian.sjoholm at gmail.com
Mon Oct 10 18:45:19 UTC 2016
> On Oct 10, 2016, at 14:24 , Bjørn Mork <bjorn at mork.no> wrote:
>
> Sebastian Sjoholm <sebastian.sjoholm at gmail.com> writes:
>
>> Hi,
>>
>> Just to add confirmation that the Quectel EC21 works as well with the same
>> modifications that was made for Quectel EC25.
>
> Could you test the attached patch against an unmodified qmi_wwan.c from
> Linux v4.5 or newer?
>
Here is test of the patch, it seems to be working very well. I have included diff from original qmi_wwan.c and then test run on both EC21 and EC25. (using kernel 4.7.7)
-Sebastian
root at z600:linux-stable# diff -u drivers/net/usb/qmi_wwan.c drivers/net/usb/qmi_wwan.c_original
--- drivers/net/usb/qmi_wwan.c 2016-10-10 20:12:35.830045859 +0200
+++ drivers/net/usb/qmi_wwan.c_original 2016-10-08 10:33:16.800256426 +0200
@@ -59,10 +59,6 @@
QMI_WWAN_FLAG_RAWIP = 1 << 0,
};
-enum qmi_wwan_quirks {
- QMI_WWAN_QUIRK_DTR = 1 << 0, /* needs "set DTR" request */
-};
-
static void qmi_wwan_netdev_setup(struct net_device *net)
{
struct usbnet *dev = netdev_priv(net);
@@ -415,14 +411,9 @@
* clearing out state the clients might need.
*
* MDM9x30 is the first QMI chipset with USB3 support. Abuse
- * this fact to enable the quirk for all USB3 devices.
- *
- * There are also chipsets with the same "set DTR" requirement
- * but without USB3 support. Devices based on these chips
- * need a quirk flag in the device ID table.
+ * this fact to enable the quirk.
*/
- if (dev->driver_info->data & QMI_WWAN_QUIRK_DTR ||
- le16_to_cpu(dev->udev->descriptor.bcdUSB) >= 0x0201) {
+ if (le16_to_cpu(dev->udev->descriptor.bcdUSB) >= 0x0201) {
qmi_wwan_manage_power(dev, 1);
qmi_wwan_change_dtr(dev, true);
}
@@ -535,16 +526,6 @@
.rx_fixup = qmi_wwan_rx_fixup,
};
-static const struct driver_info qmi_wwan_info_quirk_dtr = {
- .description = "WWAN/QMI device",
- .flags = FLAG_WWAN,
- .bind = qmi_wwan_bind,
- .unbind = qmi_wwan_unbind,
- .manage_power = qmi_wwan_manage_power,
- .rx_fixup = qmi_wwan_rx_fixup,
- .data = QMI_WWAN_QUIRK_DTR,
-};
-
#define HUAWEI_VENDOR_ID 0x12D1
/* map QMI/wwan function by a fixed interface number */
@@ -552,11 +533,6 @@
USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
.driver_info = (unsigned long)&qmi_wwan_info
-/* devices requiring "set DTR" quirk */
-#define QMI_QUIRK_SET_DTR(vend, prod, num) \
- USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
- .driver_info = (unsigned long)&qmi_wwan_info_quirk_dtr
-
/* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
#define QMI_GOBI1K_DEVICE(vend, prod) \
QMI_FIXED_INTF(vend, prod, 3)
@@ -919,8 +895,6 @@
{QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
{QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
{QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */
- {QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
- {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */
/* 4. Gobi 1000 devices */
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
root at z600:linux-stable#
*** Quectel EC25
# ./cmd.py -c raw,ati
ati
Quectel
EC25
Revision: EC25EFAR02A03M4G
OK
# /usr/bin/qmicli -d /dev/cdc-wdm0 -e
raw-ip
# /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: '2266963184'
[/dev/cdc-wdm0] Client ID not released:
Service: 'wds'
CID: '19'
# /sbin/udhcpc -q -f -S -n -i wwan0
udhcpc (v1.22.1) started
Sending discover...
Sending select for 10.39.5.19...
Lease of 10.39.5.19 obtained, lease time 7200
ip: RTNETLINK answers: File exists
# /sbin/route -v add -host 172.32.98.1 dev wwan0
# ping -c 5 172.32.98.1
PING 172.32.98.1 (172.32.98.1) 56(84) bytes of data.
64 bytes from 172.32.98.1: icmp_seq=1 ttl=62 time=217 ms
64 bytes from 172.32.98.1: icmp_seq=2 ttl=62 time=35.3 ms
64 bytes from 172.32.98.1: icmp_seq=3 ttl=62 time=34.5 ms
64 bytes from 172.32.98.1: icmp_seq=4 ttl=62 time=33.1 ms
64 bytes from 172.32.98.1: icmp_seq=5 ttl=62 time=31.1 ms
--- 172.32.98.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 31.119/70.263/217.080/73.423 ms
# /usr/bin/qmicli -d /dev/cdc-wdm0 --wds-stop-network=2266963184 --client-cid=19
Network cancelled... releasing resources
[/dev/cdc-wdm0] Network stopped
#
*** Quectel EC21
# ./cmd.py -c raw,ati
ati
Quectel
EC21
Revision: EC21EFAR02A02M4G
OK
# /usr/bin/qmicli -d /dev/cdc-wdm0 -e
raw-ip
# /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: '2274944928'
[/dev/cdc-wdm0] Client ID not released:
Service: 'wds'
CID: '19'
# /sbin/udhcpc -q -f -S -n -i wwan0
udhcpc (v1.22.1) started
Sending discover...
Sending select for 10.39.3.212...
Lease of 10.39.3.212 obtained, lease time 7200
ip: RTNETLINK answers: File exists
# ping -c 5 172.32.98.1
PING 172.32.98.1 (172.32.98.1) 56(84) bytes of data.
^C
--- 172.32.98.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3999ms
# /sbin/route -v add -host 172.32.98.1 dev wwan0
# ping -c 5 172.32.98.1
PING 172.32.98.1 (172.32.98.1) 56(84) bytes of data.
64 bytes from 172.32.98.1: icmp_seq=1 ttl=62 time=250 ms
64 bytes from 172.32.98.1: icmp_seq=2 ttl=62 time=31.9 ms
64 bytes from 172.32.98.1: icmp_seq=3 ttl=62 time=29.6 ms
64 bytes from 172.32.98.1: icmp_seq=4 ttl=62 time=28.6 ms
64 bytes from 172.32.98.1: icmp_seq=5 ttl=62 time=37.0 ms
--- 172.32.98.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 28.633/75.625/250.855/87.662 ms
# /usr/bin/qmicli -d /dev/cdc-wdm0 --wds-stop-network=2274944928 --client-cid=19
Network cancelled... releasing resources
[/dev/cdc-wdm0] Network stopped
#
More information about the libqmi-devel
mailing list