QMI channel /dev/cdc-wdmX doesn't show up

I am working on building and setting up of QMI WWAN Driver for AG35 on our embedded platform. I have followed all the instructions in the Linux USB Driver User Guide document to configure and patching the Linux kernel. However, the QMI channel /dev/cdc-wdmX doesn’t show up! Would you please give me some hints how I might debug the kernel to figure the issue out?

Some debugging info:

Linux kernel version: 4.19.94

I can see the qmi_wwan kernel module has been loaded:

root@e:/# lsmod | grep qmi
qmi_wwan 262144 0
cdc_wdm 262144 1 qmi_wwan
usbnet 262144 2 qmi_wwan,cdc_ether
usbcore 327680 9 usbserial,xhci_hcd,usbnet,cdc_wdm,usb_wwan,qmi_wwan,cdc_ether,xhci_plat_hcd,option

The list of USB ports:

root@e:/# lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
|__ Port 2: Dev 3, If 0, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 3, If 1, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 3, If 2, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 3, If 3, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 3, If 4, Class=Communications, Driver=cdc_ether, 480M
|__ Port 2: Dev 3, If 5, Class=CDC Data, Driver=cdc_ether, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M

I cannot find the corresponding device in the /dev folder!
root@e:/# ls /dev/cdc*
ls: cannot access ‘/dev/cdc*’: No such file or directory

dmesg :

root@e:/# dmesg | grep -C 15 qmi_wwan
[ 9.820461] hub 4-0:1.0: USB hub found
[ 9.824237] hub 4-0:1.0: 1 port detected
[ 10.089751] usb 3-1: new high-speed USB device number 2 using xhci-hcd
[ 10.242168] usb 3-1: New USB device found, idVendor=04b4, idProduct=6506, bcdDevice=50.00
[ 10.250390] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 10.257525] usb 3-1: Product: CY-HX3 HUB
[ 10.261452] usb 3-1: Manufacturer: 2014 Cypress Semiconductor
[ 10.267713] hub 3-1:1.0: USB hub found
[ 10.271577] hub 3-1:1.0: 2 ports detected
[ 10.561758] usb 3-1.2: new high-speed USB device number 3 using xhci-hcd
[ 10.675779] usb 3-1.2: New USB device found, idVendor=2c7c, idProduct=0125, bcdDevice= 3.18
[ 10.684138] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 10.691476] usb 3-1.2: Product: EG25-G
[ 10.695243] usb 3-1.2: Manufacturer: Quectel
[ 10.714469] usbcore: registered new interface driver cdc_wdm
[ 10.722161] usbcore: registered new interface driver qmi_wwan
[ 10.733289] usbcore: registered new interface driver option
[ 10.744741] usbserial: USB Serial support registered for GSM modem (1-port)
[ 10.750708] cdc_ether 3-1.2:1.4 usb0: register ‘cdc_ether’ at usb-xhci-hcd.3.auto-1.2, CDC Ethernet Device, f6:79:39:b2:0a:59
[ 10.763430] usbcore: registered new interface driver cdc_ether
[ 10.763553] option 3-1.2:1.0: GSM modem (1-port) converter detected
[ 10.775778] usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[ 10.783896] option 3-1.2:1.1: GSM modem (1-port) converter detected
[ 10.790470] usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[ 10.797774] option 3-1.2:1.2: GSM modem (1-port) converter detected
[ 10.804774] usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB2
[ 10.812008] option 3-1.2:1.3: GSM modem (1-port) converter detected
[ 10.819036] usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB3

Hi Armin,
according to the lsusb and dmesg output your module currently uses a USB composition with a ECM network interface.

To make the the qmi_wwan driver bind to it you have to change this with AT+QCFG=“usbnet”.

Regards,
Reinhard

Hi Reinhard,

Thank you so much.

root@e:~# socat - /dev/ttyUSB2,crnl
AT+QCFG=“usbnet”,0
OK

root@e:~# ls /dev/cdc*
/dev/cdc-wdm0

root@e:~# lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
|__ Port 2: Dev 4, If 0, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 4, If 1, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 4, If 2, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 4, If 3, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 4, If 4, Class=Vendor Specific Class, Driver=qmi_wwan, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M

Regards,
Armin