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

quentin.dore at orange.com quentin.dore at orange.com
Thu May 12 06:49:44 UTC 2016


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 ?

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"

In this case, each card has always the same cdc name and same wwan interface.

Thanks for your responses.

Quentin D.

-----Message d'origine-----
De : Bjørn Mork [mailto:bjorn at mork.no] 
Envoyé : mardi 10 mai 2016 19:09
À : Dan Williams
Cc : DORE Quentin OBS/OAB; libqmi-devel at lists.freedesktop.org
Objet : Re: Two cdc-wdm from two Sierra Wireless cards on same wwan

Dan Williams <dcbw at redhat.com> writes:

> On Tue, 2016-05-10 at 10:17 +0000, quentin.dore at orange.com wrote:
>> Hello,
>> 
>> I have sometimes an issue during the association cdc-wdm/wwan.
>
> Is the issue that the names of the devices switch around sometimes 
> between boots?
>
> If that's the case, that's just how Linux and USB work; devices have 
> variable startup/probing time and you can never be sure which device 
> will enumerate first.  The kernel simply assigns 'wwan0' to whichever 
> device is first and wwan1 to the next one.

Well, the problem seems to be that it assigns 'wwan0' to both cards.
Which is impossible AFAICS.  But there are a few seconds between each card being registered and I wonder if this is caused by something happening inbetween there.

Like:

> udev attempts to work around this by renaming devices based on the pci 
> and USB bus topology to something like wwp0s20u4, which is stable 
> across reboots.

Yes, and I have seen some of these rules using the "mac address" for their "stable names".  Which of course will fail here, since the arbitrary usbnet assigned mac address is the same for all these devices.

So what I think might happen is:
 - device 1-1.4.2 registers 'wwan0'
 - 'wwan0' is renamed by userspace to 'whateverd28dabfbd615'
 - device 1-1.4.4 registers 'wwan0', since this name is now available again
 - userspace fails to rename 'wwan0' to 'whateverd28dabfbd615' since that
   name is in use.

The fix is to make the renaming userspace tool (systemd?) behave sanely.  There is no such thing as stable names for USB devices.  And these names shouldn't matter anyway.  ModemManager vill figure out the relationship between modem, cdc-wdmX and netdevs just fine regardless of the device names involved.

> There are ways to figure out which wwan device corresponds to which 
> WDM device though, which mostly involve trawling through sysfs or 
> asking udev for that information.  You can, for example:
>
> # ls /sys/class/usbmisc/cdc-wdm0/device/net/
> wwp0s20u4
> #
>
> and the only entry in that directory should be the corresponding WWAN 
> network interface directory.

Yes, it would be good to see the output of

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




Bjørn

_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.



More information about the libqmi-devel mailing list