Two cdc-wdm from two Sierra Wireless cards on same wwan

Bjørn Mork bjorn at mork.no
Thu May 12 08:57:57 UTC 2016


<quentin.dore at orange.com> writes:

> Hello,
>
> That's correct, wwan0 is assigned to both cards.
>
> I understand that qmi_wwan assigns an interface wwan name to cdc-wdm regarding the already assigned names.
>
> The userspace application that manages each mobile interface creates also an associated network namespace and assigns the WWAN link (wwan0 or wwan1) to this namespace.
> So, if the second card is detected some time after the application has assigned the first WWAN (wwan0) to its namespace, qmi_wwan will assigned again wwan0 to the second card. Is that correct ?

No.  The X in the 'wwanX' names is assigned by the networking subsystem,
which will make sure that you cannot register two identical names.  It
will always pick the first available number and return that.  So if
'wwan0' exists, then the next one will be 'wwan1', etc.  Even if the
driver should make up these names itself, it would not be able to
register a duplicate name.  That's impossible.

So the second instance can only register 'wwan0' if there is no network
device named 'wwan0' at that point.  Which means that the first one
either has been unregistered (unlikely and should definitely show up in
the log), or renamed by userspace (very likely, and will also show up in
the log.

The cdc-wdmX naming is a completely different thing.  It does not really
support renaming.  And the X is directly derived from the minor
allocated to the character device, so if if you do try to pull games
with the name of the first device, the second will still be 'cdc-wdm1'
because the assigned minor is '1'.


>
> I have written 4 udev rules, to match USB path and create known interfaces names:
> SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-1.4.2", SYMLINK+="cdc-wdm-second"
> SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-1.4.4", SYMLINK+="cdc-wdm-first"
> SUBSYSTEM=="net", ACTION=="add", KERNEL=="wwan*", KERNELS=="1-1.4.2", NAME="wwan-1"
> SUBSYSTEM=="net", ACTION=="add", KERNEL=="wwan*", KERNELS=="1-1.4.4", NAME="wwan-0"

That's an odd way to workaround buggy userspace applications.  Show us
the output of:

 ls -ld /sys/class/usbmisc/cdc-wdm*/device/net/*

without those rules.  That should show you which name the first wwan
interface ends up with.  Then go look for the buggy udev rule renaming
it, and report a bug to whoever is responsible for that.



Bjørn


More information about the libqmi-devel mailing list