[PATCH 1/2] port-probe: add getter for ID_MM_PORT_READY_DELAY udev tag

Aleksander Morgado aleksander at aleksander.es
Tue May 1 16:43:02 UTC 2018


On Tue, May 1, 2018 at 6:19 PM, Matthew Starr <mstarr at hedonline.com> wrote:
> Added support for a ID_MM_PORT_READY_DELAY udev tag which can be used to
> delay the init of a modem.  This is useful for modems that may not
> respond correctly within some amount of time after a reset.

Unless this value is used by the generic plugin implementation
somewhere, I don't really see this as a generic setting to maintain...
The problem with this setting as it is now, is that this is not just a
"fixed" timeout that is executed for each TTY of a given modem. In the
case of the TOBY-L4, the timeout is cancelled as soon as the +READY
URC arrives, and this URC is something specific to u-blox. So this
means the logic using this tag is plugin-specific. All the other
ID_MM_PORT_xx tags managed in MMPortProbe are generic for all plugins.

Really believe this should just be a u-blox specific udev tag instead.

> ---
>  src/mm-port-probe.c | 8 ++++++++
>  src/mm-port-probe.h | 1 +
>  2 files changed, 9 insertions(+)
>
> diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
> index 13c89861..cd411c04 100644
> --- a/src/mm-port-probe.c
> +++ b/src/mm-port-probe.c
> @@ -88,6 +88,7 @@ struct _MMPortProbePrivate {
>
>      /* From udev tags */
>      gboolean is_ignored;
> +    gint ready_delay;
>
>      /* Current probing task. Only one can be available at a time */
>      GTask *task;
> @@ -1695,6 +1696,12 @@ mm_port_probe_is_ignored (MMPortProbe *self)
>      return self->priv->is_ignored;
>  }
>
> +gint
> +mm_port_probe_get_ready_delay (MMPortProbe *self)
> +{
> +    return (self->priv->ready_delay);
> +}
> +
>  const gchar *
>  mm_port_probe_get_port_name (MMPortProbe *self)
>  {
> @@ -1748,6 +1755,7 @@ set_property (GObject *object,
>          /* construct only */
>          self->priv->port = g_value_dup_object (value);
>          self->priv->is_ignored = mm_kernel_device_get_property_as_boolean (self->priv->port, "ID_MM_PORT_IGNORE");
> +        self->priv->ready_delay = mm_kernel_device_get_property_as_int (self->priv->port, "ID_MM_PORT_READY_DELAY");
>          break;
>      default:
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
> diff --git a/src/mm-port-probe.h b/src/mm-port-probe.h
> index a300092e..5f3e1763 100644
> --- a/src/mm-port-probe.h
> +++ b/src/mm-port-probe.h
> @@ -131,6 +131,7 @@ const gchar  *mm_port_probe_get_vendor       (MMPortProbe *self);
>  const gchar  *mm_port_probe_get_product      (MMPortProbe *self);
>  gboolean      mm_port_probe_is_icera         (MMPortProbe *self);
>  gboolean      mm_port_probe_is_ignored       (MMPortProbe *self);
> +gint          mm_port_probe_get_ready_delay  (MMPortProbe *self);
>
>  /* Additional helpers */
>  gboolean mm_port_probe_list_has_at_port   (GList *list);
> --
> 2.14.1
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel



-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list