shill: IsCdcEthernetModemDevice heuristic

14 views
Skip to first unread message

Evan Benn

unread,
Jun 2, 2026, 7:16:53 AM (yesterday) Jun 2
to ChromiumOS Development
Hello,

I am developing a device with a cdc_ncm interface that also exposes a cdc_acm interface. In testing on cros we notice that this code:


Assumes that any combo cdc_ncm / tty(cdc_acm) device is a modem and is treated differently than a cdc_ncm alone device. I can confirm that our device works well with chromeos when this heuristic is bypassed to force shill to treat us as a cdc_ncm. 

Is the shill heuristic a real rule based on some part of USB that I am not familiar with? (i.e. we should change our device). Alternatively would you accept a patch to add a quirks fallback to this shill function - perhaps by inspecting the vid:pid? Or is there some other fallback mechanism?

Thanks

Peter Marheine

unread,
Jun 2, 2026, 10:15:19 PM (17 hours ago) Jun 2
to Evan Benn, ChromiumOS Development
I'm unaware of any requirements around composite device classes like
that; the current behavior sure looks like a heuristic that nobody's
cared enough to make any changes to since about 2013.

As a comparison, it looks like ModemManager does some similar checks
[1]: MM_FILTER_RULE_TTY_ACM_INTERFACE matches a USB-CDC device where
the protocol is one of the AT protocols (bInterfaceProtocol is between
1 and 6, inclusive) and otherwise ignores a device. However
MM_FILTER_RULE_TTY_WITH_NET appears to decide a device that provides
both tty and net devices should be treated as a modem; it looks like
the TTY_WITH_NET check runs first and will then defer to the decision
of TTY_ACM_INTERFACE (I'm not very confident of that, though), so I
believe ModemManager will ignore a device such as yours unless udev
rules say otherwise.

So in a vacuum I imagine checking bInterfaceProtocol would be an
improvement to the existing heuristic in shill, but it's difficult to
tell if anybody depends on the current behavior who would be broken by
a change (that is, has a modem that doesn't set bInterfaceProtocol
correctly). Given ChromeOS doesn't make it possible to adjust udev
rules that seems like a risky change, but it also uses ModemManager
under the hood and I'm not sure how shill interacts with ModemManager
so perhaps it would be a strict improvement to better synchronize
their ideas of what a modem looks like.

[1]: https://modemmanager.org/docs/modemmanager/port-and-device-detection/#port-selection-filters-in-modemmanager
> --
> --
> ChromiumOS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> https://groups.google.com/a/chromium.org/group/chromium-os-dev
Reply all
Reply to author
Forward
0 new messages