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

Aleksander Morgado aleksander at aleksander.es
Mon Jan 26 13:14:30 PST 2015


On Mon, Jan 26, 2015 at 10:04 PM, Bjørn Mork <bjorn at mork.no> wrote:
>> QMI devices are split into /dev/cdc-wdm ports and WWAN net interfaces.
>> Each /dev/cdc-wdm port is uniquely associated with a given WWAN net
>> interface. When only one of each is available there's no big issue,
>> but modems exposing multiple control+net ports are very common
>> nowadays (e.g. MC7304).
>>
>>  The 'aleksander/wwan-iface' branch in upstream git allows to query
>> which is the WWAN interface name for a given QmiDevice, so it allows a
>> direct association between the /dev/cdc-wdm port and the net
>> interface.
>>
>> Also developed a new '--get-wwan-iface' command in qmicli, e.g.:
>>    $ qmicli -d /dev/cdc-wdm1 --get-wwan-iface
>>    wwp0s29u1u6i8
>>    $ qmicli -d /dev/cdc-wdm2 --get-wwan-iface
>>    wwp0s29u1u6i10
>>
>> In order to support this, libqmi would now depend on the gudev library.
>>
>> Comments on this, before merging to git master?
>>
>> http://cgit.freedesktop.org/libqmi/log/?h=aleksander/wwan-iface
>
> No objection, but I believe this info is easy to get from sysfs without
> any additional tools:
>
>  bjorn at nemi:~$ ls -l /sys/class/usbmisc/cdc-wdm0/device/net/
>  total 0
>  drwxr-xr-x 6 root root 0 Jan 26 22:00 wwan0

Yeah, maybe for this specific case where we just want to query that
device name once and we don't want udev events, it probably is worth
to just parse the sysfs path directly... Or will we ever want to get
udev events as well? E.g. Could the systemd network interface renames
affect the logic?

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list