[PATCH 04/10] api: new ReportKernelEvent() api method to report kernel device addition/removals
Aleksander Morgado
aleksander at aleksander.es
Mon Aug 29 09:25:57 UTC 2016
On Fri, Aug 19, 2016 at 9:55 PM, Dan Williams <dcbw at redhat.com> wrote:
> On Sat, 2016-08-06 at 15:03 +0200, Aleksander Morgado wrote:
>> The implementation allows different parameters being reported in the
>> kernel
>> event, but only 3 of them are mandatory: 'action', 'name' and
>> 'subsystem'. Once
>> these three parameters are received, ModemManager will load the
>> remaining kernel
>> device information directly from sysfs.
>>
>> E.g.:
>> $ sudo mmcli --report-kernel-event=" \
>> action=add, \
>> name=wwan0, \
>> subsystem=net
>>
>> The 'physdev-uid' optional parameter may be given to bind together
>> multiple
>> ports of the same device under a common known name.
>>
>> The 'physdev-vid', 'physdev-pid' and 'driver' optional parameters may
>> be given
>> to force a given device to be managed as if it was some other device.
>> This
>> doesn't have any hard use case in real life, unless for testing
>> devices (e.g. so
>> that different filters get applied during runtime).
>>
>> E.g.:
>> $ sudo mmcli --report-kernel-event=" \
>> action=add, \
>> name=wwan0, \
>> subsystem=net, \
>> physdev-uid=usb-modem-rear-usb-port, \
>> physdev-vid=1199, \
>> physdev-pid=68a2, \
>> driver=qmi_wwan"
>
> In the API docs it talks about USB vid/pid, but MM does support at
> least one PCI-native device; the Option Nozomi. SDIO also uses 16-bit
> vid/pid, though I'm not sure why anyone would use SDIO to hook up a
> WWAN modem :) Maybe just say it's a USB or PCI vid/pid for now, but
> could be used for more in the future?
>
> Which means I'm not sure it should be a 'q'. Maybe just an 's' with
> guint16 validation for now?
>
Yes, that is a good idea, will try to update the patch to reflect that.
> Also, would be nice to have some unit tests for the udev rules file
> parsing code...
>
Oh, yes, indeed, should add that.
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list