Linux QMI driver build error

i’m trying to build driver to use EM7511 and MC7430
here’s some error

[kevin@localhost GobiSerial] make rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order .cache.mk make -C /lib/modules/3.10.0-957.21.2.el7.x86_64/build M=/home/kevin/Downloads/orinigin/GobiSerial modules make[1]: Entering directory `/usr/src/kernels/3.10.0-957.21.2.el7.x86_64' CC [M] /home/kevin/Downloads/orinigin/GobiSerial/GobiSerial.o /home/kevin/Downloads/orinigin/GobiSerial/GobiSerial.c:232:2: warning: #warning "Assuming disc_mutex is locked external to the module" [-Wcpp] #warning "Assuming disc_mutex is locked external to the module" ^ /home/kevin/Downloads/orinigin/GobiSerial/GobiSerial.c: In function ‘Gobi_portremove’: /home/kevin/Downloads/orinigin/GobiSerial/GobiSerial.c:561:26: error: ‘struct usb_serial_port’ has no member named ‘number’ port_number = (u8)port->number; ^ make[2]: *** [/home/kevin/Downloads/orinigin/GobiSerial/GobiSerial.o] Error 1 make[1]: *** [_module_/home/kevin/Downloads/orinigin/GobiSerial] Error 2 make[1]: Leaving directory `/usr/src/kernels/3.10.0-957.21.2.el7.x86_64' make: *** [all] Error 2 [kevin@localhost GobiSerial]

[kevin@localhost GobiNet] make make -C /lib/modules/3.10.0-957.21.2.el7.x86_64/build M=/home/kevin/Downloads/orinigin/GobiNet modules make[1]: Entering directory `/usr/src/kernels/3.10.0-957.21.2.el7.x86_64' CC [M] /home/kevin/Downloads/orinigin/GobiNet/GobiUSBNet.o In file included from include/net/sock.h:62:0, from include/net/inet_sock.h:27, from include/net/ip.h:30, from /home/kevin/Downloads/orinigin/GobiNet/GobiUSBNet.c:94: include/linux/memcontrol.h: In function ‘task_in_memcg_oom’: include/linux/memcontrol.h:141:2: warning: return makes integer from pointer without a cast [enabled by default] return p->memcg_oom.memcg; ^ /home/kevin/Downloads/orinigin/GobiNet/GobiUSBNet.c: In function ‘GobiUSBNetProbe’: /home/kevin/Downloads/orinigin/GobiNet/GobiUSBNet.c:2963:14: error: ‘struct net_device_ops’ has no member named ‘ndo_change_mtu’ pNetDevOps->ndo_change_mtu = GobiUSBNetChangeMTU; ^ make[2]: *** [/home/kevin/Downloads/orinigin/GobiNet/GobiUSBNet.o] Error 1 make[1]: *** [_module_/home/kevin/Downloads/orinigin/GobiNet] Error 2 make[1]: Leaving directory `/usr/src/kernels/3.10.0-957.21.2.el7.x86_64' make: *** [all] Error 2 [kevin@localhost GobiNet]

I don’t see problem to compile the driver SierraLinuxQMIdriversS2.37N2.57 on Ubuntu 14.04:

owner@CNHKG-EX-001367:~/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiSerial$ sudo make
rm -rf *.o ~ core .depend ..cmd *.ko .mod.c .tmp_versions Module. modules.order .cache.mk
make -C /lib/modules/3.13.0-158-generic/build M=/home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiSerial modules
make[1]: Entering directory /usr/src/linux-headers-3.13.0-158-generic' CC [M] /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiSerial/GobiSerial.o /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiSerial/GobiSerial.c:232:2: warning: #warning "Assuming disc_mutex is locked external to the module" [-Wcpp] #warning "Assuming disc_mutex is locked external to the module" ^ Building modules, stage 2. MODPOST 1 modules CC /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiSerial/GobiSerial.mod.o LD [M] /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiSerial/GobiSerial.ko make[1]: Leaving directory/usr/src/linux-headers-3.13.0-158-generic’

owner@CNHKG-EX-001367:~/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiSerial$ cd …
owner@CNHKG-EX-001367:~/QMI/SierraLinuxQMIdriversS2.37N2.57$ cd GobiNet/
owner@CNHKG-EX-001367:~/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet$ sudo make
make -C /lib/modules/3.13.0-158-generic/build M=/home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet modules
make[1]: Entering directory /usr/src/linux-headers-3.13.0-158-generic' CC [M] /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/GobiUSBNet.o In file included from include/net/sock.h:57:0, from include/net/inet_sock.h:27, from include/net/ip.h:30, from /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/GobiUSBNet.c:94: include/linux/memcontrol.h: In function ‘task_in_memcg_oom’: include/linux/memcontrol.h:154:2: warning: return makes integer from pointer without a cast [enabled by default] return p->memcg_oom.memcg; ^ /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/GobiUSBNet.c: At top level: /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/GobiUSBNet.c:109:2: warning: #warning "Remove memcontrol.h task_in_memcg_oom warning : replace 'return p->memcg_oom.memcg;' to 'return p->memcg_oom.memcg==NULL ? 0 : 1;' in function task_in_memcg_oom" [-Wcpp] #warning "Remove memcontrol.h task_in_memcg_oom warning : replace 'return p->memcg_oom.memcg;' to 'return p->memcg_oom.memcg==NULL ? 0 : 1;' in function task_in_memcg_oom" ^ /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/GobiUSBNet.c:110:2: warning: #warning "Commnet '#define MEMCG_NOT_FIX' above after fix applied." [-Wcpp] #warning "Commnet '#define MEMCG_NOT_FIX' above after fix applied." ^ CC [M] /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/QMIDevice.o CC [M] /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/QMI.o LD [M] /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/GobiNet.o Building modules, stage 2. MODPOST 1 modules CC /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/GobiNet.mod.o LD [M] /home/owner/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet/GobiNet.ko make[1]: Leaving directory/usr/src/linux-headers-3.13.0-158-generic’
owner@CNHKG-EX-001367:~/QMI/SierraLinuxQMIdriversS2.37N2.57/GobiNet$

i’m using CentOs 7.6

Can you have a try on this version? (i can compile in CentOS7.6)
S2.28N2.42.zip (107.9 KB)

I can compile S2.28N2.42 on CentOS7.6, however, after make install, blacklist qc_serial qmi_wwan, there is no /dev/qcqmi0 or /dev/qcqmi1. ip link does not show the EM7455 as an interface. I can get /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2 but am unable to bring up a network. ModemManager and NetworkManager are disabled.

How can I get the qcqmi0 interface?

Okay. Problem was NetworkManger was disabled - when enable /dev/qcqmi0 being assigned.

Now, using the fwdwl-litehostx86_64 from SLQS04.00.22-lite.bin.tar SampleApps/lite-fw-download/bin to update the FW, I am seeing kernel panic.

[root@localhost tmp]# ./fwdwl-litehostx86_64 -d /dev/ttyUSB0 -p /dev/qcqmi0 -m 3 -f SWI9X30C_02.32.11.00_ATT_002.070_000/
litefw version :lite-fwSLQS04.00.22
INFO: QDL Port : /dev/ttyUSB0
INFO: Device Path: /dev/qcqmi0
INFO: FW Path : SWI9X30C_02.32.11.00_ATT_002.070_000/
Package Info:
Carrier :ATT
FW Version :02.32.11.00
Model ID :SWI9X30C
Package ID :000
PRI Version:002.070
SKU :9999999
Part Number:9904594
file_type : 6
CWE+NVU
Set pref ImageTypesSize: 2
Modem Needs FW
Modem Needs PRI
QMI current modem power 3
Waiting for modem to disconnect [ 4304.299933] ------------[ cut here ]------------
from the host af[ 4304.305870] WARNING: CPU: 0 PID: 1730 at /root/workspace/S2.28N2.42/GobiSerial/GobiSerial.c:226 Gobi_dtr_rts+0x16e/0x1a0 [GobiSerial]
[ 4304.320808] Modules linked in: vfat fat uaster reset comman usb_storaged is i ip6t_rpfilter
ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat iptable_mangle iptable_security iptable_raw nf_conntrack ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter intel_powerclamp coretemp kvm_intel kvm irqbypass crc32_pclmul iTCO_wdt ghash_clmulni_intel gpio_ich iTCO_vendor_support aesni_intel GobiSerial(OE) lrw gf128mul glue_helper ablk_helper cryptd GobiNet(OE) wdat_wdt pcspkr sg usbnet ipmi_ssif mii i2c_i801 lpc_ich ipmi_devintf ipmi_msghandler i2c_ismt ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_generic ahci libahci igb libata crct10dif_pclmul crct10dif_common crc32c_intel ptp serio_raw pps_core i2c_algo_bit dca
[ 4304.417958] CPU: 0 PID: 1730 Comm: fwdwl-litehostx Kdump: loaded Tainted: G OE ------------ 3.10.0-1062.4.3.el7.x86_64 #1
[ 4304.431476] Hardware name: To be filled by O.E.M. To be filled by O.E.M./To be filled by O.E.M., BIOS 5.6.5 03/11/2019
[ 4304.443436] Call Trace:
[ 4304.446172] [] dump_stack+0x19/0x1b
[ 4304.451922] [] __warn+0xd8/0x100
[ 4304.457379] [] warn_slowpath_null+0x1d/0x20
[ 4304.463912] [] Gobi_dtr_rts+0x16e/0x1a0 [GobiSerial]
[ 4304.471312] [] ? usb_serial_generic_open+0x50/0x60
[ 4304.478514] [] serial_port_dtr_rts+0x29/0x30
[ 4304.485127] [] tty_port_block_til_ready+0x169/0x230
[ 4304.492428] [] ? wake_up_atomic_t+0x30/0x30
[ 4304.498952] [] tty_port_open+0xaa/0xe0
[ 4304.504989] [] serial_open+0x33/0x60
[ 4304.510834] [] tty_open+0x11b/0x690
[ 4304.516581] [] chrdev_open+0xb5/0x1b0
[ 4304.522522] [] do_dentry_open+0x216/0x2c0
[ 4304.528851] [] ? security_inode_permission+0x22/0x30
[ 4304.536248] [] ? cdev_put+0x30/0x30
[ 4304.541994] [] vfs_open+0x5a/0xb0
[ 4304.547547] [] ? may_open+0xa3/0x120
[ 4304.553390] [] do_last+0x1f6/0x1290
[ 4304.559139] [] path_openat+0xcd/0x5a0
[ 4304.565080] [] do_filp_open+0x4d/0xb0
[ 4304.571023] [] ? __alloc_fd+0x47/0x170
[ 4304.577061] [] do_sys_open+0x124/0x220
[ 4304.583099] [] SyS_open+0x1e/0x20
[ 4304.588652] [] system_call_fastpath+0x25/0x2a
[ 4304.595370] —[ end trace 33f9612d5342877d ]—

Seems that the GobiSerial driver is breaking. How can one perform a FW update using CentOS 7.6 with SLQS04.00.22-lite?

What is the latest version of QMI drivers that will work with CentOS 7.6 (kernel 3.10)? S2.28N2.42 appears to be working, but, not with latest API.

Did kernel log show any hints on gobinet driver?
I tried to connect WP7605 to centOS, I can see the /dev/qcqmi0 port.


[ 1455.679980] usb 1-1: New USB device found, idVendor=1199, idProduct=68c0
[ 1455.679994] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1455.680005] usb 1-1: Product: Sierra Wireless WP7605
[ 1455.680015] usb 1-1: Manufacturer: Sierra Wireless, Incorporated
[ 1455.680026] usb 1-1: SerialNumber: 2A91728507040403
[ 1455.808953] GobiNet 1-1:1.8 eth0: register ‘GobiNet’ at usb-0000:02:03.0-1, GobiNet Ethernet Device, 16:b1:07:81:d8:be
[ 1455.878796] USB Speed : USB 2.0
[ 1455.930539] cdc_ether 1-1:1.19 usb0: register ‘cdc_ether’ at usb-0000:02:03.0-1, CDC Ethernet Device, aa:d6:aa:04:90:e9
[ 1456.898322] IPv6: ADDRCONF(NETDEV_UP): ens35u1i19: link is not ready
[ 1457.010424] IPv6: ADDRCONF(NETDEV_UP): ens35u1i8: link is not ready
[ 1457.010604] IPv6: ADDRCONF(NETDEV_UP): ens35u1i8: link is not ready
[ 1457.942796] e1000: ens33 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
[ 1460.692484] TE Flow Control disabled
[ 1461.504227] creating qcqmi0
[ 1461.508159] RawIP mode
[owner@localhost GobiNet] ls /dev/qcqmi0 /dev/qcqmi0 [owner@localhost GobiNet] modinfo GobiNet
filename: /lib/modules/3.10.0-957.el7.x86_64/kernel/drivers/net/usb/GobiNet.ko
license: Dual BSD/GPL
description: GobiNet
author: Qualcomm Innovation Center
version: 2017-04-05/SWI_2.42
retpoline: Y
rhelversion: 7.6
srcversion: 61832D2CF4F8DCAE933EE06
alias: usb:v1199p9110ddcdscdpiciscipin
alias: usb:v1199p9102ddcdscdpiciscipin
alias: usb:v1199p9100ddcdscdpiciscipin
alias: usb:v1199p9070ddcdscdpiciscipin
alias: usb:v1199p9061ddcdscdpiciscipin
alias: usb:v1199p9056ddcdscdpiciscipin
alias: usb:v1199p9055ddcdscdpiciscipin
alias: usb:v1199p9054ddcdscdpiciscipin
alias: usb:v1199p9053ddcdscdpiciscipin
alias: usb:v1199p9051ddcdscdpiciscipin
alias: usb:v1199p9041ddcdscdpiciscipin
alias: usb:v1199p68C0ddcdscdpiciscipin
alias: usb:v1199p9071ddcdscdpiciscipin
alias: usb:v03F0p371Dddcdscdpiciscipin
alias: usb:v1199p9019ddcdscdpiciscipin
alias: usb:v1199p9015ddcdscdpiciscipin
alias: usb:v1199p9013ddcdscdpiciscipin
alias: usb:v1199p9011ddcdscdpiciscipin
alias: usb:v05C6p920Dddcdscdpiciscipin
alias: usb:v1199p68A2ddcdscdpiciscipin
depends: usbnet
vermagic: 3.10.0-957.el7.x86_64 SMP mod_unload modversions
parm: debug:Debuging enabled or not (int)
parm: qos_debug:QoS Debuging enabled or not (int)
parm: interruptible:Listen for and return on user interrupt (int)
parm: txQueueLength:Number of IP packets which may be queued up for transmit (int)
parm: iTEEnable:TE Flow Control enabled or not (int)
parm: iRAWIPEnable:RAWIP enabled or not (int)

Maybe you can try newer version of gobiserial. Gobiserial is needed for fw update.

In general, I’d say it’s almost impossible to use any out-of-tree driver with CentOS or RHEL kernels. They backport both features and arbitrary bug fixes to their kernels without changing the version numbers accordingly.

The WARN (which is not a panic) you are hitting is wrapped in a complex set of kernel version checks, trying to make the driver compatible with kernels both before and after a specific usb-serial change:

#if ((KERNEL_SERIES( 3,4 ) && LINUX_VERSION_CODE >= KERNEL_VERSION( 3,4,34 )) || \
     (KERNEL_SERIES( 3,2 ) && LINUX_VERSION_CODE >= KERNEL_VERSION( 3,2,0 )) || \
     (KERNEL_SERIES( 3,5 ) && LINUX_VERSION_CODE >= KERNEL_VERSION( 3,5,0 )) || \
     (KERNEL_SERIES( 3,7 ) && LINUX_VERSION_CODE >= KERNEL_VERSION( 3,7,10 )) || \
     (KERNEL_SERIES( 3,8 ) && LINUX_VERSION_CODE >= KERNEL_VERSION( 3,8,1) ) || \
     (LINUX_VERSION_CODE >= KERNEL_VERSION( 3,8,1) ))
/* workaround for upstream commit b2ca699076573c94fee9a73cb0d8645383b602a0 */
#warning "Assuming disc_mutex is locked external to the module"
static inline void Gobi_lock_disc_mutex(struct usb_serial *serial) {
   if (LINUX_VERSION_CODE < KERNEL_VERSION( 3,12,0) )
   {
      WARN_ON(!mutex_is_locked(&serial->disc_mutex));
   }
}
static inline void Gobi_unlock_disc_mutex(struct usb_serial *serial) {}
#else
/* use the legacy method of locking disc_mutex in this driver */
#warning "Using legacy method of locking disc_mutex"
static inline void Gobi_lock_disc_mutex(struct usb_serial *serial) {
   mutex_lock(&serial->disc_mutex);
}
static inline void Gobi_unlock_disc_mutex(struct usb_serial *serial) {
   mutex_unlock(&serial->disc_mutex);
}
#endif

I didn’t bother checking, but I am pretty sure you’ll find that CentOS changed this driver API without updating the LINUX_VERSION_CODE accordingly. They do stuff like that all the time.