[PATCH] kernel-device: device-specific properties in either port or physdev

Aleksander Morgado aleksander at aleksander.es
Wed Mar 22 08:42:57 UTC 2017


On 21/03/17 22:08, Dan Williams wrote:
>> There are 2 main types of udev properties: device-specific and
>> port-specific.
>>
>> The port-specific properties are set independently per port (e.g.
>> port
>> type hints set per interface number for a given vid:pid).
>>
>> The device-specific properties apply to all ports in the device. Some
>> of these properties are currently expected in the physical device
>> (e.g. ID_MM_PLATFORM_DRIVER_PROBE) while some others are expected in
>> each port (e.g. the plugin udev tag filters).
>>
>> This patch tries to simplify the logic and just assume that the
>> device
>> specific tags may be given in either the physical device or the port
>> device, by providing separate APIs to retrieve port-specific or
>> device-specific (global) properties. If the same tag is given in both
>> the device and the port, the one in the device takes preference.
>>
>> For the generic backend, these new APIs are really useless, as all
>> device-specific and port-specific properties are always stored in the
>> port object themselves (there is no 'tree' of devices in the generic
>> backend, no 'physdev' device).
>>
>> For the udev backend, though, there really is a difference, as the
>> tags may be set in port or device.
>>
>> https://bugs.freedesktop.org/show_bug.cgi?id=100156
>> ---
>>
>> Hey Dan, Ben and everyone,
>>
>> The rationale for this is that we may want to have udev rules that
>> apply to all ports in a device one by one, or udev rules that apply
>> only to the physical device object, and in both cases they should be
>> treated in the same way.
>>
>> This patch therefore differenciates between port-specific and device-
>> specific tags when the program reads them.
>>
>> What does everyone think?
> LGTM.

Pushed to git master

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list