cdc_ncm tagging of Huawei devices as wwan

Dan Williams dcbw at redhat.com
Tue Nov 19 10:22:20 PST 2013


On Tue, 2013-11-19 at 16:05 +0100, Aleksander Morgado wrote:
> On 19/11/13 14:21, Bjørn Mork wrote:
> >>>>> Hard to tell... I guess we'll end up needing either a list of wwan
> >>>>> >>> > modules or a list of non-wwan modules, whatever is easier?
> >>> >> I guess that is easy after all: I current know of 1 - one - non-wwan PID
> >>> >> and 0 - zero - wwan PIDs.
> >>> >> 
> >>> >> So it has to be wwan by default with a per-PID non-wwan whitelist.
> >> >
> >> > I wonder if some automagic can be setup so that e.g. if the device
> >> > doesn't expose an AT port it is by default non-wwan.
> > It's hard to do that in the kernel.
> > 
> > The whole wlan/eth/usb/wwan type issue is misplaced.  That kind of
> > information has never had anything to do in the kernel, and we've seen
> > it for a long time.  Having to add specific entries in class drivers
> > flagging devices as "wwan" is so wrong it's not even funny.  But it's
> > probably too late to whine more about that.
> > 
> > But maybe userspace should just start to ignore some of these kernel
> > hints, taking them as nothing more than hints?
> 
> In particular, ModemManager won't do anything if it only gets a wwan
> port from a device, it will just completely ignore it. Didn't check, but
> maybe NetworkManager is actually assuming that if the net device is
> flagged as wwan then it's MM territory, while it shouldn't do that?

NM will ignore any device tagged as DEVTYPE=wwan by the kernel because
they look exactly like plain Ethernet interfaces otherwise.

Without a tag there's no way to know that some other control interface
is required before the device is useful.  And if the user has configured
NM for default-DHCP autoconnect, NM has no way to know that it shouldn't
do DHCP on the device, because there's no way to know that it needs that
control port...  The interface shows up via udev like any other ethernet
device, and it might be some time before ModemManager announces that it
"owns" the device.  In between there is where we have the problem.

Creative thoughts on the problem are certainly entertained.  NM delaying
ethernet device detection until MM finds it doesn't work well, nor would
having MM emit a signal saying "I claim usb0 until I release it", since
that doesn't solve the problem of suppressing the interface if MM isn't
running...

Yes, tagging in userspace would also work, but carries other problems
with it (duplication of kernel VID/PID lists, users abusing the tags for
other purposes, etc).  And yes, kernel tagging has cons too.

Dan




More information about the ModemManager-devel mailing list