EM7565 1199:90b1 USBx qcserial issue Ubuntu 20.04 MBPL driver fail to compile

Hi guys,

Sierra module: EM7565 vid: 1199 pid: 90b1
Laptop model: Dell latitude 5420
OS version: Ubuntu 20.04 server x86_64 installed with enabled HWE
Kernel: 5.13.0-30-generic
Bios: wwan module is presented as USB device

As far as i am awared there are two modes in which this module can operate

  • MBIM : cdc_mbim and qcserial drivers are required <<— i decided to use this mode
  • RmNet : qmi_wwan and qcserial drivers are required
type or paste code hereroot@x:~#dmesg 
[ 8868.229561] usb 4-4: new SuperSpeed USB device number 3 using xhci_hcd
[ 8868.251397] usb 4-4: New USB device found, idVendor=1199, idProduct=90b1, bcdDevice= 0.06
[ 8868.251406] usb 4-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 8868.251409] usb 4-4: Product: EM7565
[ 8868.251412] usb 4-4: Manufacturer: Sierra Wireless, Incorporated
[ 8868.256058] usb 4-4: Enable of device-initiated U1 failed.
[ 8868.256518] usb 4-4: Enable of device-initiated U2 failed.
[ 8868.278918] cdc_mbim 4-4:1.0: cdc-wdm0: USB WDM device
[ 8868.279260] cdc_mbim 4-4:1.0 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-4, CDC MBIM, 52:54:35:02:12:ce
[ 8868.279720] usb 4-4: Enable of device-initiated U1 failed.
[ 8868.280197] usb 4-4: Enable of device-initiated U2 failed.


root@x:~# lsusb
Bus 004 Device 002: ID 1199:90b1 Sierra Wireless, Inc. EM7565
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 0a5c:5843 Broadcom Corp. 58200
Bus 003 Device 002: ID 1bcf:28cc Sunplus Innovation Technology Inc. Integrated_Webcam_HD
Bus 003 Device 004: ID 8087:0026 Intel Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


root@x:~# usb-devices -t
T:  Bus=04 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
D:  Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs=  1
P:  Vendor=1199 ProdID=90b1 Rev=00.06
S:  Manufacturer=Sierra Wireless, Incorporated
S:  Product=EM7565
C:  #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
I:  If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
I:  If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)

As you can see there is not qcserial driver assigned to usb interfaces 0x2 0x3 0x4
By default when the os boot cdc_mbim module is loaded but not the same with qcserial

root@x:~# lsmod | grep mbim
cdc_mbim               20480  0
cdc_wdm                24576  1 cdc_mbim
cdc_ncm                45056  1 cdc_mbim
usbnet                 49152  3 cdc_mbim,cdc_ncm,cdc_ether

root@x:~# lsmod | grep qcserial
root@x:~# 

Nothing happend when the module has been loaded manually.
I checked the github qcserial repo linux/qcserial.c at v5.13 · torvalds/linux · GitHub
And i saw that this vid and pid are not in v5.13 even in the newers tags

I also tried to manually load them but this does not help

echo "1199 90b1" > /sys/bus/usb-serial/drivers/qcserial/new_id

dmesg errors

[ 1032.684075] usb 4-4: unknown number of interfaces: 5
[ 1032.684102] usb 4-4: unknown number of interfaces: 5
[ 1032.684115] usb 4-4: unknown number of interfaces: 5

Then i decided to download ( MBPL_Drivers_R24_ENG3-src.tar.gz ) and compile them from USB sub directory.
Also i saw that vid and pid are there.
The compiling failed with the fowoling error:

root@x:/home/admin/gps/src/USB# make
make -C /lib/modules/5.13.0-30-generic/build M=/home/admin/gps/src/USB
make[1]: Entering directory '/usr/src/linux-headers-5.13.0-30-generic'
  CC [M]  /home/admin/gps/src/USB/qcserial.o
/home/admin/gps/src/USB/qcserial.c:734:22: error: initialization of ‘void (*)(struct usb_serial_port *)’ from incompatible pointer type ‘int (*)(struct usb_serial_port *)’ [-Werror=incompatible-pointer-types]
  734 |  .port_remove      = usb_wwan_port_remove,
      |                      ^~~~~~~~~~~~~~~~~~~~
/home/admin/gps/src/USB/qcserial.c:734:22: note: (near initialization for ‘qcdevice.port_remove’)
/home/admin/gps/src/USB/qcserial.c:761:22: error: initialization of ‘void (*)(struct usb_serial_port *)’ from incompatible pointer type ‘int (*)(struct usb_serial_port *)’ [-Werror=incompatible-pointer-types]
  761 |  .port_remove      = usb_wwan_port_remove,
      |                      ^~~~~~~~~~~~~~~~~~~~
/home/admin/gps/src/USB/qcserial.c:761:22: note: (near initialization for ‘qcdevice_1.port_remove’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:281: /home/admin/gps/src/USB/qcserial.o] Error 1
make[1]: *** [Makefile:1879: /home/admin/gps/src/USB] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.13.0-30-generic'
make: *** [Makefile:12: all] Error 2
root@x:/home/admin/gps/src/USB# 

root@x:/home/admin/gps/src/USB# dpkg -l | grep make
ii  make                                  4.2.1-1.2                             amd64        utility for directing compilation
ii  xxd                                   2:8.1.2269-1ubuntu5.7                 amd64        tool to make (or reverse) a hex dump


root@x:/home/admin/gps/src/USB# dpkg -l | grep gcc
ii  gcc                                   4:9.3.0-1ubuntu2                      amd64        GNU C compiler
ii  gcc-10-base:amd64                     10.3.0-1ubuntu1~20.04                 amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-9                                 9.3.0-17ubuntu1~20.04                 amd64        GNU C compiler
ii  gcc-9-base:amd64                      9.3.0-17ubuntu1~20.04                 amd64        GCC, the GNU Compiler Collection (base package)
ii  libgcc-9-dev:amd64                    9.3.0-17ubuntu1~20.04                 amd64        GCC support library (development files)
ii  libgcc-s1:amd64                       10.3.0-1ubuntu1~20.04                 amd64        GCC support library

Can somenone advise how to compile these drivers in order to see USBx there
Tanks in advance.

Just short update

I think that this issue is from kernel compatibility.

Drivers were successfully build on Ubuntu VM 20.04 with older kernel 5.4.0-96-generic, however this kernel is older and ethernet driver does not work for the laptop.

I also did an another test on Ubuntu 22.04 server x64 with kernel 5.15.0-18-generic latest for Ubuntu website and received following errors

root@test:/home/test/gps/src/USB# make
make -C /lib/modules/5.15.0-18-generic/build M=/home/test/gps/src/USB
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-18-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 11.2.0-14ubuntu1) 11.2.0
  You are using:           gcc (Ubuntu 11.2.0-16ubuntu1) 11.2.0
  CC [M]  /home/test/gps/src/USB/qcserial.o
/home/test/gps/src/USB/qcserial.c:727:32: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  727 |         .write_room          = usb_wwan_write_room,
      |                                ^~~~~~~~~~~~~~~~~~~
/home/test/gps/src/USB/qcserial.c:727:32: note: (near initialization for ‘qcdevice.write_room’)
/home/test/gps/src/USB/qcserial.c:728:32: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  728 |         .chars_in_buffer     = usb_wwan_chars_in_buffer,
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~
/home/test/gps/src/USB/qcserial.c:728:32: note: (near initialization for ‘qcdevice.chars_in_buffer’)
/home/test/gps/src/USB/qcserial.c:734:32: error: initialization of ‘void (*)(struct usb_serial_port *)’ from incompatible pointer type ‘int (*)(struct usb_serial_port *)’ [-Werror=incompatible-pointer-types]
  734 |         .port_remove         = usb_wwan_port_remove,
      |                                ^~~~~~~~~~~~~~~~~~~~
/home/test/gps/src/USB/qcserial.c:734:32: note: (near initialization for ‘qcdevice.port_remove’)
/home/test/gps/src/USB/qcserial.c:754:32: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  754 |         .write_room          = usb_wwan_write_room,
      |                                ^~~~~~~~~~~~~~~~~~~
/home/test/gps/src/USB/qcserial.c:754:32: note: (near initialization for ‘qcdevice_1.write_room’)
/home/test/gps/src/USB/qcserial.c:755:32: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  755 |         .chars_in_buffer     = usb_wwan_chars_in_buffer,
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~
/home/test/gps/src/USB/qcserial.c:755:32: note: (near initialization for ‘qcdevice_1.chars_in_buffer’)
/home/test/gps/src/USB/qcserial.c:761:32: error: initialization of ‘void (*)(struct usb_serial_port *)’ from incompatible pointer type ‘int (*)(struct usb_serial_port *)’ [-Werror=incompatible-pointer-types]
  761 |         .port_remove         = usb_wwan_port_remove,
      |                                ^~~~~~~~~~~~~~~~~~~~
/home/test/gps/src/USB/qcserial.c:761:32: note: (near initialization for ‘qcdevice_1.port_remove’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:285: /home/test/gps/src/USB/qcserial.o] Error 1
make[1]: *** [Makefile:1880: /home/test/gps/src/USB] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-18-generic'
make: *** [Makefile:12: all] Error 2
root@test:/home/test/gps/src/USB# 

Is there a compatibility kernel list for these drivers or any advise how i can build them ?
From this test of the module depend purchase from our company, so any help will be appreciated.

Thank you in advance.

Hi pettrovvf23231,

Sierra has been aware of this issue. It has been forwarded to the development team for analysis.

1 Like

Hi Donald,

Thanks for your response. Looking forward for update about this issue.

Thanks in advance.

Hello All! I am having a similar issue with an EM7355 in a USB adapter, running Ubuntu 20.04 with the 5.13.0-39-generic kernel. I was wondering if there was any update for a solution to this problem?

HI Donald,

Any update about this issue ?

Thank you in advance.

Hi pettrovvf23231 ,

This issue can be addressed in MBPL R27. Please try to download MBPL_DRIVER_R27_ENG2-usb-src.tar at the link below and retry.
Mobile Broadband Package for Linux

Hi Donald,

I can confirm that driver MBPL R27 was compiled successfully for both Ubuntu 20.04 and 22.04. Thanks.

Is there any reason the required changes have not been submitted to the upstream kernel, putting extra burden on every user?

This should have been done months ago. Instead users have to recompile kernel modules (typically breaking Secureboot) on every kernel update, and hope the compilation works at all.

I obviously cannot answer why Sierra Wireless doesn’t work closer with upstream, but I honestly don’t think the qcserial changes make any sense.

Sure, they’ll “work” under the given conditions. But it’s a mess and it’s fragile.

The fundamental concept of the qcserial driver is grouping of multifunction devices with similar layout. So far there are there 4 such layouts defined:

enum qcserial_layouts {
QCSERIAL_G2K = 0, /* Gobi 2000 /
QCSERIAL_G1K = 1, /
Gobi 1000 /
QCSERIAL_SWI = 2, /
Sierra Wireless /
QCSERIAL_HWI = 3, /
Huawei */
};

For a very long time Sierra Wireless used static interface numbers to identify functions. E.g 2 => NMEA. And this is what the QCSERIAL_SWI layout describes. But they dropped that with the latest modem generation, apparently using dynamic interface numbering. This means that there isn’t any static scheme we can use to identify the serial functions anymore.

What the’re doing in the MBPL package is add 3 more arbitrary layouts, describing a few of the resulting combinations. But there is no guarantee that these are complete. Add of remove a function and numbering will change. In any case, the new schemes are very device specific. If they can be reused, then that’s by pure chance and nothing else. This makes a mess out of the qcserial driver for no good reason at all.

The serical functions can probably be mapped by class codes, like we’ve done for X55 modems from other vendors. But if they can’t then, at least they should have device specific entries. Most likely in the option driver, which has the infrastructure to support such devices.

FYI - the option driver and the qcserial driver are just frontends for the same usb-wwan driver. They are functionally the same, using different logic to match devices/functions.

FWIW, handling the QDL function inside qcserial works and makes some sense. It has used the same static layout with a single serial function since the Gobi 1000 days.

1 Like