Use a specific device ?

Aleksander Morgado aleksander at aleksander.es
Thu May 28 13:19:17 PDT 2015


On Thu, May 28, 2015 at 9:54 PM, Dan Williams <dcbw at redhat.com> wrote:
> How about just reading g_udev_device_get_device_file_symlinks () and
> exposing that information as an "Aliases(as)" property on the MMModem
> object?
>

Oh, I didn't know about g_udev_device_get_device_file_symlinks (),
that would be the cleanest way to do it.

But anyway, wouldn't you need an array of strings per each port that
the modem has? E.g. what if you want to explicitly tag/link different
ports in different ways and detect which tag/link was added to each
port?

Also, given that we already expose the list of ports, if someone needs
to know the list of links for each port, why don't they use
g_udev_device_get_device_file_symlinks () directly themselves?

> # cat /etc/udev/rules.d/90-huawei-symlink.rules
> ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1001", SUBSYSTEM=="tty", SYMLINK+="gsmmodem1_%n"
>
> # udevadm info --query=all /dev/ttyUSB2
> ...
> S: gsmmodem1_2
> S: serial/by-id/usb-ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_HUAWEI_Mobile-if02-port0
> S: serial/by-path/pci-0000:00:14.0-usb-0:1:1.2-port0
> ...
>
> I suppose we could also do this on the NM side instead of ModemManager,
> but that would prevent other non-udev-based schemed in ModemManager in
> the future.  I guess I'm fine with either way, either a new MM property
> or having NM look this up.

Well, if we're targeting just the use case where we need to bind NM
connection settings to a specific 'alias', we wouldn't need the
per-port array of strings. But if we end up doing this, is this the
only usecase we should be targeting?

I still think that the unbound settings is much simpler to setup and
use in this specific usecase...

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list