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

Bjørn Mork bjorn at mork.no
Tue May 10 17:08:47 UTC 2016


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


More information about the libqmi-devel mailing list