Querying WWAN iface name for each /dev/cdc-wdm device

Aleksander Morgado aleksander at aleksander.es
Tue Jan 27 06:04:36 PST 2015


On Tue, Jan 27, 2015 at 12:36 PM, Bjørn Mork <bjorn at mork.no> wrote:
> Marius Kotsbak <marius at kotsbak.com> writes:
>> 2015-01-27 9:34 GMT+01:00 Bjørn Mork <bjorn at mork.no>:
>>
>>> Aleksander Morgado <aleksander at aleksander.es> writes:
>>> > On Mon, Jan 26, 2015 at 10:04 PM, Bjørn Mork <bjorn at mork.no> wrote:
>>>
>>>  bjorn at nemi:~$ ls -l /sys/class/net/bar/device/usbmisc
>>>  total 0
>>>  drwxr-xr-x 3 root root 0 Jan 27 09:20 cdc-wdm0
>>>
>>> The only undetected renaming issue I can think of is if someone renames
>>> the file in /dev so it doesn't match the kernel device name. I don't
>>> think that is very likely though, and IMHO it should not be supported.
>>> You can do it, but then you're on your own...
>>>
>>
>> What if someone is following this example:
>>
>> KERNEL=="eth*", ATTR{address}=="00:52:8b:d5:04:48", NAME="lan"
>>
>> It is then probably better to use the SYMLINK option in that case though.
>
> I believe that will make udev rename the device via netlink, just like
> 'ip link set eth0 name lan' will do.  Isn't that correct?
>
> If so, then it should work fine.  The kernel device name changes and
> sysfs will use the new name.
>
> Note that the 'bar' in my example above wasn't a fake.
>
>

In order to handle the case of the renames, I guess libqmi shouldn't
cache the net iface name the first time it's read, right? I mean if
someone calls qmi_device_get_wwan_iface() we better get the filename
directly from sysfs every time?


-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list