diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-03-06 12:01:56 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-03-22 09:40:10 +0100 |
commit | 00fb9e98f6003f6b167f7d12a895ec3d1402b027 (patch) | |
tree | d1fc5df50bfec704fb257bb7dc8091fe64163eb9 /plugins | |
parent | 230e732a24e0e925f535839caecc4a69d89ab89e (diff) |
kernel-device: device-specific properties in either port or physdev
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
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/dell/mm-plugin-dell.c | 2 | ||||
-rw-r--r-- | plugins/huawei/mm-broadband-modem-huawei.c | 2 | ||||
-rw-r--r-- | plugins/huawei/mm-plugin-huawei.c | 2 | ||||
-rw-r--r-- | plugins/simtech/mm-plugin-simtech.c | 2 | ||||
-rw-r--r-- | plugins/telit/mm-common-telit.c | 2 | ||||
-rw-r--r-- | plugins/zte/mm-plugin-zte.c | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/plugins/dell/mm-plugin-dell.c b/plugins/dell/mm-plugin-dell.c index 5efcb192..f9dfd1a6 100644 --- a/plugins/dell/mm-plugin-dell.c +++ b/plugins/dell/mm-plugin-dell.c @@ -342,7 +342,7 @@ dell_custom_init (MMPortProbe *probe, /* Dell-branded Telit modems always answer to +GMI * Avoid +CGMI and ATI sending for minimizing port probing time */ - if (mm_kernel_device_get_property_as_boolean (port_device, "ID_MM_TELIT_PORTS_TAGGED")) { + if (mm_kernel_device_get_global_property_as_boolean (port_device, "ID_MM_TELIT_PORTS_TAGGED")) { ctx->cgmi_retries = 0; ctx->ati_retries = 0; } diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c index 607e14ee..0e375e13 100644 --- a/plugins/huawei/mm-broadband-modem-huawei.c +++ b/plugins/huawei/mm-broadband-modem-huawei.c @@ -2367,7 +2367,7 @@ ensure_ndisdup_support_checked (MMBroadbandModemHuawei *self, /* First, check for devices which support NDISDUP on any AT port. These * devices are tagged by udev */ - if (mm_kernel_device_get_property_as_boolean (mm_port_peek_kernel_device (port), "ID_MM_HUAWEI_NDISDUP_SUPPORTED")) { + if (mm_kernel_device_get_global_property_as_boolean (mm_port_peek_kernel_device (port), "ID_MM_HUAWEI_NDISDUP_SUPPORTED")) { mm_dbg ("This device (%s) can support ndisdup feature", mm_port_get_device (port)); self->priv->ndisdup_support = FEATURE_SUPPORTED; } diff --git a/plugins/huawei/mm-plugin-huawei.c b/plugins/huawei/mm-plugin-huawei.c index 83667955..deb17510 100644 --- a/plugins/huawei/mm-plugin-huawei.c +++ b/plugins/huawei/mm-plugin-huawei.c @@ -292,7 +292,7 @@ huawei_custom_init_step (HuaweiCustomInitContext *ctx) /* Try to get a port map from the modem */ port = mm_port_probe_peek_port (ctx->probe); - if (!ctx->getportmode_done && !mm_kernel_device_get_property_as_boolean (port, "ID_MM_HUAWEI_DISABLE_GETPORTMODE")) { + if (!ctx->getportmode_done && !mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_HUAWEI_DISABLE_GETPORTMODE")) { if (ctx->getportmode_retries == 0) { g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); huawei_custom_init_context_complete_and_free (ctx); diff --git a/plugins/simtech/mm-plugin-simtech.c b/plugins/simtech/mm-plugin-simtech.c index 54544aa0..b150868f 100644 --- a/plugins/simtech/mm-plugin-simtech.c +++ b/plugins/simtech/mm-plugin-simtech.c @@ -98,7 +98,7 @@ grab_port (MMPlugin *self, * to show up with more than two AT-capable ports. */ if (pflags == MM_PORT_SERIAL_AT_FLAG_NONE && - mm_kernel_device_get_property_as_boolean (port, "ID_MM_SIMTECH_TAGGED")) + mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_SIMTECH_TAGGED")) ptype = MM_PORT_TYPE_IGNORED; } diff --git a/plugins/telit/mm-common-telit.c b/plugins/telit/mm-common-telit.c index 3f2cce5c..3c913de2 100644 --- a/plugins/telit/mm-common-telit.c +++ b/plugins/telit/mm-common-telit.c @@ -330,7 +330,7 @@ telit_custom_init (MMPortProbe *probe, ctx->getportcfg_retries = 3; /* If the device is tagged for supporting #PORTCFG do the custom init */ - if (mm_kernel_device_get_property_as_boolean (port_device, "ID_MM_TELIT_PORTS_TAGGED")) { + if (mm_kernel_device_get_global_property_as_boolean (port_device, "ID_MM_TELIT_PORTS_TAGGED")) { telit_custom_init_step (ctx); return; } diff --git a/plugins/zte/mm-plugin-zte.c b/plugins/zte/mm-plugin-zte.c index 172f275e..3a87c376 100644 --- a/plugins/zte/mm-plugin-zte.c +++ b/plugins/zte/mm-plugin-zte.c @@ -141,7 +141,7 @@ grab_port (MMPlugin *self, } } - if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_ZTE_ICERA_DHCP")) { + if (mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_ZTE_ICERA_DHCP")) { mm_dbg ("ZTE: Icera-based modem will use DHCP"); g_object_set (modem, MM_BROADBAND_MODEM_ICERA_DEFAULT_IP_METHOD, MM_BEARER_IP_METHOD_DHCP, |