libqmi / Quectel EC21/EC25

Sebastian Sjoholm sebastian.sjoholm at gmail.com
Sat Oct 8 23:19:36 UTC 2016


> On Oct 8, 2016, at 23:06 , Bjørn Mork <bjorn at mork.no> wrote:
> 
> Sebastian Sjoholm <sebastian.sjoholm at gmail.com> writes:
> 
>>> 
>>>> 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);
>>>> < 	}
>>> 
>>> 
>>> I don't understand.  Except for the redundant IFF_NOARP (set in
>>> qmi_wwan_netdev_setup), this should be exactly the same as the
>>> 
>>> 		qmi_wwan_change_dtr(dev, true);
>>> 
>>> I asked you to try to enable unconditionally.  And that didn't work?
>>> 
>> 
>> I did try that, yes, but I got the same timeout error with qmicli, but I will check again, and let you know.
>> 
>> Just to make sure I get it right;
>> 
>> instead of
>> 
>>        if (le16_to_cpu(dev->udev->descriptor.bcdUSB) >= 0x0201) {
>>                qmi_wwan_manage_power(dev, 1);
>>                qmi_wwan_change_dtr(dev, true);
>>        }
>> 
>> I will just have
>> 
>>       qmi_wwan_manage_power(dev, 1);
>>       qmi_wwan_change_dtr(dev, true);
>> 
>> And of course comment out the changes in “qmi_wwan_bind”.
> 
> Yes.  That should have the same effect.  If it doesn't, then there must
> be something magic going on.  Could be related to timing/ordering of
> course.  Could you generate a context diff (diff -u) of the changes you
> have made, so that we can see where that control message is sent?
> 
> 

So I reverted back,

# diff -u linux-stable/drivers/net/usb/qmi_wwan.c linux-stable/drivers/net/usb/qmi_wwan.c_original
--- linux-stable/drivers/net/usb/qmi_wwan.c	2016-10-09 00:13:04.713628421 +0200
+++ linux-stable/drivers/net/usb/qmi_wwan.c_original	2016-10-08 10:33:16.800256426 +0200
@@ -924,12 +924,8 @@
 	{QMI_GOBI_DEVICE(0x05c6, 0x9225)},	/* Sony Gobi 2000 Modem device (N0279, VU730) */
 	{QMI_GOBI_DEVICE(0x05c6, 0x9245)},	/* Samsung Gobi 2000 Modem device (VL176) */
 	{QMI_GOBI_DEVICE(0x03f0, 0x251d)},	/* HP Gobi 2000 Modem device (VP412) */
-	/* Quectel conflicts with Acer */
-	/* {QMI_GOBI_DEVICE(0x05c6, 0x9215)},*/ /* Acer Gobi 2000 Modem device (VP413) */
-	{QMI_FIXED_INTF(0x05c6, 0x9215, 4)},    /* Quectel EC20 Mini PCIe */
-	{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 */
+	{QMI_GOBI_DEVICE(0x05c6, 0x9215)},	/* Acer Gobi 2000 Modem device (VP413) */
+	{QMI_FIXED_INTF(0x05c6, 0x9215, 4)},	/* Quectel EC20 Mini PCIe */
 	{QMI_GOBI_DEVICE(0x05c6, 0x9265)},	/* Asus Gobi 2000 Modem device (VR305) */
 	{QMI_GOBI_DEVICE(0x05c6, 0x9235)},	/* Top Global Gobi 2000 Modem device (VR306) */
 	{QMI_GOBI_DEVICE(0x05c6, 0x9275)},	/* iRex Technologies Gobi 2000 Modem device (VR307) */
#

#  /usr/bin/qmicli -d /dev/cdc-wdm0 -E raw-ip
[/dev/cdc-wdm0] expected data format set to: raw-ip
#  /usr/bin/qmicli -d /dev/cdc-wdm0 --wds-start-network=lte1.dynamic.com --client-no-release-cid
error: couldn't create client for the 'wds' service: CID allocation failed in the CTL client: Transaction timed out
#

So it seems clear that the “qmi_wwan_change_dtr” is working, I must have done something wrong last week when I was testing.

How do you suggest me to change the lines so they would work for Quectel EC25/EC21 as well.

Here is the USB data for EC25;

Bus 002 Device 003: ID 2c7c:0125  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x2c7c 
  idProduct          0x0125 
  bcdDevice            3.18
  iManufacturer           1 Android
  iProduct                2 Android
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          209
    bNumInterfaces          5
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x89  EP 9 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x88  EP 8 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

Regards,
Sebastian



More information about the libqmi-devel mailing list