<div dir="auto">For all practical reasons and looking ahead, I truly believe that there will be no reason to have a WebUSB header in any of the few coming modem devices (what are the stats on new USB CDC modems for these years in general? - still enough to justify a "blanket claim as modem"?) as having a functioning/practical webusb header requires an existing internet connection letting you access the hardware from a trusted URL.<div dir="auto"><br></div><div dir="auto">In any case - even if some few would decide to try the combo - the far majority would not and the same logic (the user can just make a udev rule...Not sure how to explain my wife how ;)) to whitelist those would be the logical approach.</div><div dir="auto"><br></div><div dir="auto">Even if it is decided that MM should still try to claim the CDC interface (which I think would be very wrong as a default in this case), the remaining WebUSB, custom class (yet CDC style), Bulk interface should be left untouched and available to user space browsers.</div><div dir="auto"><br></div><div dir="auto">Btw on the Mac, they seem to have fixed it nicely by creating two logical tty devices and not claiming anything before the user tries to access either the modem one or pure data one (same physical interface - different protocol "on demand").</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Jan 9, 2017 19:40, "Dan Williams" <<a href="mailto:dcbw@redhat.com">dcbw@redhat.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, <a href="tel:2017-01-09" value="+4520170109">2017-01-09</a> at 19:22 +0100, Lars Knudsen wrote:<br>
> On Jan 9, 2017 18:56, "Bjørn Mork" <<a href="mailto:bjorn@mork.no">bjorn@mork.no</a>> wrote:<br>
><br>
> > Lars Knudsen <<a href="mailto:larsgk@gmail.com">larsgk@gmail.com</a>> writes:<br>
> ><br>
> > > It seemed like if just one interface in the description list was<br>
> > > somehow<br>
> > > compliant with modem manager, the full device seemed claimed.<br>
> > ><br>
> > > I may have missed something in my headers while experimenting.<br>
> > > Can you<br>
> ><br>
> > give<br>
> > > an example of a header structure that will not be assumed to be a<br>
> > > modem<br>
> ><br>
> > by<br>
> > > MM while still accessible as a proper CDC serial device - without<br>
> > > blacklisting anything?<br>
> ><br>
> > I am slowly starting to wonder if the concern is about composite<br>
> > devices<br>
> > where you want a subset of the functions to be used in one context<br>
> > (MM)<br>
> > and another subset to be used in another context (WebUSB)?  Is this<br>
> > correct?<br>
> ><br>
><br>
> Well, ideally, any WebUSB device that exposes a CDC interface (e.g.<br>
> configured with [0]CDC INT, [1]CDC BULK and [2]WebUSB CDC/BULK)<br>
> would:<br>
><br>
> 1) not be considered a modem (it would not make sense to do a modem<br>
> including webusb headers - in the same device mode at least)<br>
> 2) provide standard /dev/ttyUSBx serial functionality on the standard<br>
> CDC<br>
> endpoints (e.g. interface 1 above)<br>
> 3) provide full user access to the WebUSB CDC/BULK interface (2<br>
> above)<br>
<br>
So I read the spec quickly but clearly not well enough.<br>
<br>
Is the separate WebUSB interface parallel to the others in<br>
functionality?  eg, it's just another conduit for the same information<br>
as the other interfaces?  Or is it some other completely separate<br>
protocol?<br>
<br>
Let's take two-tty CDC-ACM, one cdc-ether modem normally controlled<br>
with AT commands, like a Nokia 21M-02.  It exposes 8 interfaces; 3 ttys<br>
and one ethernet device:<br>
<br>
0 - cdc-acm commc<br>
1 - cdc-acm data<br>
2 - cdc-acm commc<br>
3 - cdc-acm data<br>
4 - cdc-acm commc<br>
5 - cdc-acm data<br>
6 - cdc-ether commc<br>
7 - cdc-ether data<br>
<br>
Now if that supported webusb, would you have:<br>
<br>
8 - webusb<br>
<br>
If that is true, then what is supposed to happen with this modem when<br>
you plug it in?  Just because it has a WebUSB descriptor, should it be<br>
automatically "claimed" by a running browser or such, and be<br>
unavailable to the rest of the system?  Would all the ttys and ethernet<br>
devs be re-permissioned to the browser user?<br>
<br>
Or, could you expand on "it wouldn't make sense" to do a modem with<br>
WebUSB descriptors?  Why not?<br>
<br>
> What I was asking before is for an example header/configuration<br>
> descriptors<br>
> where MM would *not* pick up the CDC interface but the system still<br>
> creating a /dev/ttyUSBx device (or ttyACMx - which it's called when<br>
> MM is<br>
> installed) - without creating blacklisting rules specifically for<br>
> e.g.<br>
> *that* VID/PID combo.<br>
<br>
It depends. If MM is running and MM has been configured to probe<br>
devices (which can be easily changed with udev rules) then MM will<br>
probe and claim any device that it determines is a modem, including<br>
devices that expose ttys that respond to queries like AT+GCAP<br>
indicating they support WWAN standards.  Also including cdc-wdm devices<br>
that speak QMI or MBIM or AT.<br>
<br>
So it's certianly possible to configure the scenario you're trying, if<br>
you use udev rules to blacklist devices or if you disable probing<br>
entirely.<br>
<br>
If you can write udev rules that detect the presence of a webusb<br>
descriptor, then you can disable MM probing for that device too.<br>
<br>
> When I was experimenting the last few days - this did not seem<br>
> possible.  I<br>
> had to completely wipe any indication of this device being CDC before<br>
> MM<br>
> stopped claiming it.  Surely, MM should not pick it up if the device<br>
> indicates it doesn't have call functionality?<br>
<br>
MM disregards the "call functionality" part because only Nokia and<br>
Ericsson ever actually filled that in.  Nobody really cares about<br>
getting the detailed parts of cdc-acm correct, and because there's no<br>
real certification or anything, nobody bothered.  So these fields are<br>
essentially useless in the real world.<br>
<br>
Same reason some vendors put "0123456789abcdef" into the USB serial<br>
number field for *every single device* of a given VID/PID.  You simply<br>
cannot rely on vendors getting descriptors correct.<br>
<br>
Dan<br>
<br>
> ><br>
> > If so, then I believe you won't be able handle that in a single<br>
> > configuration.  If you mix all functions in a single configuration<br>
> > then<br>
> > you are correct that MM will take control of the device based on<br>
> > the<br>
> > functions it (or the kernel) supports.<br>
> ><br>
> > Split the function subsets in different configurations and make the<br>
> > OS<br>
> > and/or userspace select the active one if you need to support these<br>
> > different use cases.  Anything else is going to be an endless mess<br>
> > of<br>
> > workarounds and quirk lists all over the place.<br>
> ><br>
> ><br>
> > Bjørn<br>
> ><br>
><br>
> ______________________________<wbr>_________________<br>
> systemd-devel mailing list<br>
> <a href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.<wbr>freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/systemd-devel</a><br>
</blockquote></div></div>