Ease testing on /dev/cdc-wdmX where X > 0

Bjørn Mork bjorn at mork.no
Tue Mar 27 04:51:36 PDT 2012


I do most of my testing on a laptop with a builtin Ericsson modem
providing two proper cdc-wdm interfaces taking AT commands.  This is
quite useful as it forces me not to assume anything wrt the available
device numbering :-)

The typical configuration with Ericsson modem and two Huawei modems with
QMI support is:

bjorn at nemi:~$ ls -l /sys/class/net/wwan*
lrwxrwxrwx 1 root root 0 Mar 27 09:16 /sys/class/net/wwan0 -> ../../devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4:1.7/net/wwan0
lrwxrwxrwx 1 root root 0 Mar 27 09:21 /sys/class/net/wwan1 -> ../../devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.4/net/wwan1
lrwxrwxrwx 1 root root 0 Mar 27 09:22 /sys/class/net/wwan2 -> ../../devices/pci0000:00/0000:00:1a.7/usb1/1-1/1-1:1.4/net/wwan2
bjorn at nemi:~$ ls -l /sys/class/usb/cdc-wdm*
lrwxrwxrwx 1 root root 0 Mar 27 09:17 /sys/class/usb/cdc-wdm0 -> ../../devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4:1.5/usb/cdc-wdm0
lrwxrwxrwx 1 root root 0 Mar 27 09:17 /sys/class/usb/cdc-wdm1 -> ../../devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4:1.6/usb/cdc-wdm1
lrwxrwxrwx 1 root root 0 Mar 27 09:21 /sys/class/usb/cdc-wdm2 -> ../../devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.3/usb/cdc-wdm2
lrwxrwxrwx 1 root root 0 Mar 27 09:22 /sys/class/usb/cdc-wdm3 -> ../../devices/pci0000:00/0000:00:1a.7/usb1/1-1/1-1:1.3/usb/cdc-wdm3

Note that the mapping here is 

wwan0 <=> cdc-wdm0 _and_ cdc-wdm1
wwan1 <=> cdc-wdm2
wwan2 <=> cdc-wdm3

But this can of course change depending on when the devices were
plugged.  I believe it would be wise to ensure that everything works
from the start for the case where X > 0 in /dev/cdc-wdmX (and also the
case where Y != X in wwanY once you start connect anything to network
device)

Anyway, for now it would be nice if the hardcoded device file in the
tests was something different than /dev/cdc-wdm0.  Making it e.g. 
/dev/qmi would at least let me run the tests after creating a symlink to
the wanted device.


Bjørn


More information about the libqmi-devel mailing list