<p dir="ltr">Awsome! Thank you </p>
<br><div class="gmail_quote"><div dir="ltr">Il mer 10 ago 2016 09:53 Aleksander Morgado <<a href="mailto:aleksander@aleksander.es">aleksander@aleksander.es</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Aug 8, 2016 at 3:47 PM, Carlo Lobrano <<a href="mailto:c.lobrano@gmail.com" target="_blank">c.lobrano@gmail.com</a>> wrote:<br>
> BaseModem<br>
>   added reprobe property.<br>
><br>
> MMDevice<br>
>   added logic to recreate the modem if it is set invalid and "to reprobe"<br>
><br>
> MMBroadbandModem<br>
>  * added initialization step for SIM hot swap:<br>
>     1. keep dedicated ports open to listen to modem's unsolicited<br>
>     2. dedicated error management in case of initialization failure due to SIM missing<br>
>  * added function to be called in order to act upon SIM insertion/removal:<br>
>     1. close dedicated ports<br>
>     2. set the modem to be reprobed<br>
>     3. disable modem<br>
>  * added SIM HOT SWAP boolean property<br>
><br>
> MMIfaceModem<br>
>  * added initialization step for SIM hot swap, if supported by the plugin<br>
>  * dedicated error management in case of initialization failure due to SIM missing<br>
><br>
> ---<br>
><br>
> Hi Aleksander,<br>
><br>
> hope this time the patch works fine :)<br>
> The previous one had issues probably because I was keeping two different branches, one for the changes to the core and one for the plugin.<br>
><br>
> The main changes are in patch 1/2, according to your last code review.<br>
><br>
<br>
Pushed to git master. I did some minor follow up coding style changes<br>
in a separate commit, btw.<br>
<br>
Thanks!<br>
<br>
<br>
> Best regards,<br>
> Carlo<br>
><br>
> ---<br>
>  src/mm-base-modem.c      |  26 ++++++++++<br>
>  src/mm-base-modem.h      |   4 ++<br>
>  src/mm-broadband-modem.c | 120 +++++++++++++++++++++++++++++++++++++++++++++--<br>
>  src/mm-broadband-modem.h |   4 ++<br>
>  src/mm-device.c          |  15 ++++++<br>
>  src/mm-iface-modem.c     |  56 ++++++++++++++++++++++<br>
>  src/mm-iface-modem.h     |  17 +++++--<br>
>  7 files changed, 233 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c<br>
> index 9cd7c5f..ede014b 100644<br>
> --- a/src/mm-base-modem.c<br>
> +++ b/src/mm-base-modem.c<br>
> @@ -47,6 +47,7 @@ enum {<br>
>      PROP_VENDOR_ID,<br>
>      PROP_PRODUCT_ID,<br>
>      PROP_CONNECTION,<br>
> +    PROP_REPROBE,<br>
>      PROP_LAST<br>
>  };<br>
><br>
> @@ -70,6 +71,7 @@ struct _MMBaseModemPrivate {<br>
><br>
>      gboolean hotplugged;<br>
>      gboolean valid;<br>
> +    gboolean reprobe;<br>
><br>
>      guint max_timeouts;<br>
><br>
> @@ -392,6 +394,24 @@ mm_base_modem_set_valid (MMBaseModem *self,<br>
>      }<br>
>  }<br>
><br>
> +void<br>
> +mm_base_modem_set_reprobe (MMBaseModem *self,<br>
> +                           gboolean reprobe)<br>
> +{<br>
> +    g_return_if_fail (MM_IS_BASE_MODEM (self));<br>
> +<br>
> +    self->priv->reprobe = reprobe;<br>
> +}<br>
> +<br>
> +gboolean<br>
> +mm_base_modem_get_reprobe (MMBaseModem *self)<br>
> +{<br>
> +    g_return_val_if_fail (MM_IS_BASE_MODEM (self), FALSE);<br>
> +<br>
> +    return self->priv->reprobe;<br>
> +}<br>
> +<br>
> +<br>
>  gboolean<br>
>  mm_base_modem_get_valid (MMBaseModem *self)<br>
>  {<br>
> @@ -1295,6 +1315,9 @@ set_property (GObject *object,<br>
>      case PROP_VALID:<br>
>          mm_base_modem_set_valid (self, g_value_get_boolean (value));<br>
>          break;<br>
> +    case PROP_REPROBE:<br>
> +        mm_base_modem_set_reprobe (self, g_value_get_boolean (value));<br>
> +        break;<br>
>      case PROP_MAX_TIMEOUTS:<br>
>          self->priv->max_timeouts = g_value_get_uint (value);<br>
>          break;<br>
> @@ -1338,6 +1361,9 @@ get_property (GObject *object,<br>
>      case PROP_VALID:<br>
>          g_value_set_boolean (value, self->priv->valid);<br>
>          break;<br>
> +    case PROP_REPROBE:<br>
> +        g_value_set_boolean (value, self->priv->reprobe);<br>
> +        break;<br>
>      case PROP_MAX_TIMEOUTS:<br>
>          g_value_set_uint (value, self->priv->max_timeouts);<br>
>          break;<br>
> diff --git a/src/mm-base-modem.h b/src/mm-base-modem.h<br>
> index 3c0d16f..c4bcdce 100644<br>
> --- a/src/mm-base-modem.h<br>
> +++ b/src/mm-base-modem.h<br>
> @@ -166,6 +166,10 @@ void     mm_base_modem_set_valid    (MMBaseModem *self,<br>
>                                       gboolean valid);<br>
>  gboolean mm_base_modem_get_valid    (MMBaseModem *self);<br>
><br>
> +void     mm_base_modem_set_reprobe (MMBaseModem *self,<br>
> +                                    gboolean reprobe);<br>
> +gboolean mm_base_modem_get_reprobe (MMBaseModem *self);<br>
> +<br>
>  const gchar  *mm_base_modem_get_device  (MMBaseModem *self);<br>
>  const gchar **mm_base_modem_get_drivers (MMBaseModem *self);<br>
>  const gchar  *mm_base_modem_get_plugin  (MMBaseModem *self);<br>
> diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c<br>
> index 04c716d..3ebe8c5 100644<br>
> --- a/src/mm-broadband-modem.c<br>
> +++ b/src/mm-broadband-modem.c<br>
> @@ -114,6 +114,7 @@ enum {<br>
>      PROP_MODEM_MESSAGING_SMS_DEFAULT_STORAGE,<br>
>      PROP_MODEM_VOICE_CALL_LIST,<br>
>      PROP_MODEM_SIMPLE_STATUS,<br>
> +    PROP_MODEM_SIM_HOT_SWAP_SUPPORTED,<br>
>      PROP_LAST<br>
>  };<br>
><br>
> @@ -126,7 +127,9 @@ typedef struct _PortsContext PortsContext;<br>
>  struct _MMBroadbandModemPrivate {<br>
>      /* Broadband modem specific implementation */<br>
>      PortsContext *enabled_ports_ctx;<br>
> +    PortsContext *sim_hot_swap_ports_ctx;<br>
>      gboolean modem_init_run;<br>
> +    gboolean sim_hot_swap_supported;<br>
><br>
>      /*<--- Modem interface --->*/<br>
>      /* Properties */<br>
> @@ -8549,6 +8552,11 @@ disabling_stopped (MMBroadbandModem *self,<br>
>          ports_context_unref (self->priv->enabled_ports_ctx);<br>
>          self->priv->enabled_ports_ctx = NULL;<br>
>      }<br>
> +<br>
> +    if (self->priv->sim_hot_swap_ports_ctx) {<br>
> +        ports_context_unref (self->priv->sim_hot_swap_ports_ctx);<br>
> +        self->priv->sim_hot_swap_ports_ctx = NULL;<br>
> +    }<br>
>      return TRUE;<br>
>  }<br>
><br>
> @@ -9667,6 +9675,7 @@ typedef enum {<br>
>      INITIALIZE_STEP_IFACE_SIGNAL,<br>
>      INITIALIZE_STEP_IFACE_OMA,<br>
>      INITIALIZE_STEP_IFACE_FIRMWARE,<br>
> +    INITIALIZE_STEP_SIM_HOT_SWAP,<br>
>      INITIALIZE_STEP_IFACE_SIMPLE,<br>
>      INITIALIZE_STEP_LAST,<br>
>  } InitializeStep;<br>
> @@ -10008,6 +10017,38 @@ initialize_step (InitializeContext *ctx)<br>
>                                              ctx);<br>
>          return;<br>
><br>
> +    case INITIALIZE_STEP_SIM_HOT_SWAP:<br>
> +        {<br>
> +            gboolean is_sim_hot_swap_supported = FALSE;<br>
> +<br>
> +            g_object_get (ctx->self,<br>
> +                          MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED,<br>
> +                          &is_sim_hot_swap_supported,<br>
> +                          NULL);<br>
> +<br>
> +            if (!is_sim_hot_swap_supported) {<br>
> +                ctx->self->priv->sim_hot_swap_ports_ctx = NULL;<br>
> +            } else {<br>
> +                PortsContext *ports;<br>
> +                GError *error = NULL;<br>
> +<br>
> +                mm_dbg ("Creating PortsContext for SIM hot swap.");<br>
> +<br>
> +                ports = g_new0 (PortsContext, 1);<br>
> +                ports->ref_count = 1;<br>
> +<br>
> +                if (!open_ports_enabling (ctx->self, ports, FALSE, &error)) {<br>
> +                    mm_warn ("Couldn't open ports during Modem SIM hot swap enabling: %s", error? error->message : "unknown reason");<br>
> +                    g_error_free (error);<br>
> +                } else<br>
> +                    ctx->self->priv->sim_hot_swap_ports_ctx = ports_context_ref (ports);<br>
> +<br>
> +                ports_context_unref (ports);<br>
> +            }<br>
> +        }<br>
> +        /* Fall down to next step */<br>
> +        ctx->step++;<br>
> +<br>
>      case INITIALIZE_STEP_IFACE_SIMPLE:<br>
>          if (ctx->self->priv->modem_state != MM_MODEM_STATE_FAILED)<br>
>              mm_iface_modem_simple_initialize (MM_IFACE_MODEM_SIMPLE (ctx->self));<br>
> @@ -10028,11 +10069,35 @@ initialize_step (InitializeContext *ctx)<br>
>                                                   "cannot fully initialize");<br>
>              } else {<br>
>                  /* Fatal SIM, firmware, or modem failure :-( */<br>
> -                g_simple_async_result_set_error (ctx->result,<br>
> -                                                 MM_CORE_ERROR,<br>
> -                                                 MM_CORE_ERROR_WRONG_STATE,<br>
> -                                                 "Modem is unusable, "<br>
> -                                                 "cannot fully initialize");<br>
> +                gboolean is_sim_hot_swap_supported = FALSE;<br>
> +                MMModemStateFailedReason reason =<br>
> +                    mm_gdbus_modem_get_state_failed_reason (<br>
> +                        (MmGdbusModem*)ctx->self->priv->modem_dbus_skeleton);<br>
> +<br>
> +                g_object_get (ctx->self,<br>
> +                             MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED,<br>
> +                             &is_sim_hot_swap_supported,<br>
> +                             NULL);<br>
> +<br>
> +                if (reason == MM_MODEM_STATE_FAILED_REASON_SIM_MISSING &&<br>
> +                    is_sim_hot_swap_supported &&<br>
> +                    ctx->self->priv->sim_hot_swap_ports_ctx) {<br>
> +                        mm_info ("SIM is missing, but the modem supports SIM hot swap. Waiting for SIM...");<br>
> +                        g_simple_async_result_set_error (ctx->result,<br>
> +                                                         MM_CORE_ERROR,<br>
> +                                                         MM_CORE_ERROR_WRONG_STATE,<br>
> +                                                         "Modem is unusable due to SIM missing, "<br>
> +                                                         "cannot fully initialize, "<br>
> +                                                         "waiting for SIM insertion.");<br>
> +                } else {<br>
> +                    mm_dbg ("SIM is missing and Modem does not support SIM Hot Swap");<br>
> +                    g_simple_async_result_set_error (ctx->result,<br>
> +                                                     MM_CORE_ERROR,<br>
> +                                                     MM_CORE_ERROR_WRONG_STATE,<br>
> +                                                     "Modem is unusable, "<br>
> +                                                     "cannot fully initialize");<br>
> +                }<br>
> +<br>
>                  /* Ensure we only leave the Modem, OMA, and Firmware interfaces<br>
>                   * around.  A failure could be caused by firmware issues, which<br>
>                   * a firmware update, switch, or provisioning could fix.<br>
> @@ -10045,6 +10110,7 @@ initialize_step (InitializeContext *ctx)<br>
>                  mm_iface_modem_voice_shutdown (MM_IFACE_MODEM_VOICE (ctx->self));<br>
>                  mm_iface_modem_time_shutdown (MM_IFACE_MODEM_TIME (ctx->self));<br>
>                  mm_iface_modem_simple_shutdown (MM_IFACE_MODEM_SIMPLE (ctx->self));<br>
> +<br>
>              }<br>
>              initialize_context_complete_and_free (ctx);<br>
>              return;<br>
> @@ -10192,6 +10258,39 @@ mm_broadband_modem_create_device_identifier (MMBroadbandModem *self,<br>
>                      MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton))));<br>
>  }<br>
><br>
> +<br>
> +/*****************************************************************************/<br>
> +static void<br>
> +after_hotswap_event_disable_ready (MMBaseModem *self,<br>
> +                                   GAsyncResult *res,<br>
> +                                   gpointer user_data)<br>
> +{<br>
> +    GError *error = NULL;<br>
> +    mm_base_modem_disable_finish (self, res, &error);<br>
> +    if (error) {<br>
> +        mm_err ("Disable modem error: %s", error->message);<br>
> +        g_error_free (error);<br>
> +    } else {<br>
> +        mm_base_modem_set_valid (MM_BASE_MODEM (self), FALSE);<br>
> +    }<br>
> +}<br>
> +<br>
> +<br>
> +void<br>
> +mm_broadband_modem_update_sim_hot_swap_detected (MMBroadbandModem *self)<br>
> +{<br>
> +    if (self->priv->sim_hot_swap_ports_ctx) {<br>
> +        mm_dbg ("Releasing SIM hot swap ports context");<br>
> +        ports_context_unref (self->priv->sim_hot_swap_ports_ctx);<br>
> +        self->priv->sim_hot_swap_ports_ctx = NULL;<br>
> +    }<br>
> +<br>
> +    mm_base_modem_set_reprobe (MM_BASE_MODEM (self), TRUE);<br>
> +    mm_base_modem_disable (MM_BASE_MODEM (self),<br>
> +                           (GAsyncReadyCallback) after_hotswap_event_disable_ready,<br>
> +                           NULL);<br>
> +}<br>
> +<br>
>  /*****************************************************************************/<br>
><br>
>  MMBroadbandModem *<br>
> @@ -10323,6 +10422,9 @@ set_property (GObject *object,<br>
>          g_clear_object (&self->priv->modem_simple_status);<br>
>          self->priv->modem_simple_status = g_value_dup_object (value);<br>
>          break;<br>
> +    case PROP_MODEM_SIM_HOT_SWAP_SUPPORTED:<br>
> +        self->priv->sim_hot_swap_supported = g_value_get_boolean (value);<br>
> +        break;<br>
>      default:<br>
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);<br>
>          break;<br>
> @@ -10425,6 +10527,9 @@ get_property (GObject *object,<br>
>      case PROP_MODEM_SIMPLE_STATUS:<br>
>          g_value_set_object (value, self->priv->modem_simple_status);<br>
>          break;<br>
> +    case PROP_MODEM_SIM_HOT_SWAP_SUPPORTED:<br>
> +        g_value_set_boolean (value, self->priv->sim_hot_swap_supported);<br>
> +        break;<br>
>      default:<br>
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);<br>
>          break;<br>
> @@ -10453,6 +10558,7 @@ mm_broadband_modem_init (MMBroadbandModem *self)<br>
>      self->priv->modem_messaging_sms_default_storage = MM_SMS_STORAGE_UNKNOWN;<br>
>      self->priv->current_sms_mem1_storage = MM_SMS_STORAGE_UNKNOWN;<br>
>      self->priv->current_sms_mem2_storage = MM_SMS_STORAGE_UNKNOWN;<br>
> +    self->priv->sim_hot_swap_supported = FALSE;<br>
>  }<br>
><br>
>  static void<br>
> @@ -10907,4 +11013,8 @@ mm_broadband_modem_class_init (MMBroadbandModemClass *klass)<br>
>      g_object_class_override_property (object_class,<br>
>                                        PROP_MODEM_SIMPLE_STATUS,<br>
>                                        MM_IFACE_MODEM_SIMPLE_STATUS);<br>
> +<br>
> +    g_object_class_override_property (object_class,<br>
> +                                      PROP_MODEM_SIM_HOT_SWAP_SUPPORTED,<br>
> +                                      MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED);<br>
>  }<br>
> diff --git a/src/mm-broadband-modem.h b/src/mm-broadband-modem.h<br>
> index 93ffeb5..9cb3494 100644<br>
> --- a/src/mm-broadband-modem.h<br>
> +++ b/src/mm-broadband-modem.h<br>
> @@ -127,5 +127,9 @@ gboolean mm_broadband_modem_lock_sms_storages_finish (MMBroadbandModem *self,<br>
>  void     mm_broadband_modem_unlock_sms_storages      (MMBroadbandModem *self,<br>
>                                                        gboolean mem1,<br>
>                                                        gboolean mem2);<br>
> +/* Helper to update SIM hot swap */<br>
> +void mm_broadband_modem_update_sim_hot_swap_detected (MMBroadbandModem *self);<br>
> +<br>
> +<br>
><br>
>  #endif /* MM_BROADBAND_MODEM_H */<br>
> diff --git a/src/mm-device.c b/src/mm-device.c<br>
> index 2456cc8..8435cf1 100644<br>
> --- a/src/mm-device.c<br>
> +++ b/src/mm-device.c<br>
> @@ -489,8 +489,23 @@ modem_valid (MMBaseModem *modem,<br>
>               MMDevice    *self)<br>
>  {<br>
>      if (!mm_base_modem_get_valid (modem)) {<br>
> +        GDBusObjectManagerServer *object_manager = self->priv->object_manager;<br>
> +<br>
>          /* Modem no longer valid */<br>
>          mm_device_remove_modem (self);<br>
> +<br>
> +        if (mm_base_modem_get_reprobe (modem)) {<br>
> +            GError *error = NULL;<br>
> +<br>
> +            if (!mm_device_create_modem (self, object_manager, &error)) {<br>
> +                 mm_warn ("Could not recreate modem for device at '%s': %s",<br>
> +                         mm_device_get_path (self),<br>
> +                         error ? error->message : "unknown");<br>
> +                g_error_free (error);<br>
> +            } else {<br>
> +                mm_dbg ("Modem recreated for device '%s'", mm_device_get_path (self));<br>
> +            }<br>
> +        }<br>
>      } else {<br>
>          /* Modem now valid, export it, but only if we really have it around.<br>
>           * It may happen that the initialization sequence fails because the<br>
> diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c<br>
> index 30fe20d..c942e7b 100644<br>
> --- a/src/mm-iface-modem.c<br>
> +++ b/src/mm-iface-modem.c<br>
> @@ -3747,6 +3747,7 @@ typedef enum {<br>
>      INITIALIZATION_STEP_SUPPORTED_BANDS,<br>
>      INITIALIZATION_STEP_SUPPORTED_IP_FAMILIES,<br>
>      INITIALIZATION_STEP_POWER_STATE,<br>
> +    INITIALIZATION_STEP_SIM_HOT_SWAP,<br>
>      INITIALIZATION_STEP_UNLOCK_REQUIRED,<br>
>      INITIALIZATION_STEP_SIM,<br>
>      INITIALIZATION_STEP_OWN_NUMBERS,<br>
> @@ -4203,6 +4204,27 @@ load_current_bands_ready (MMIfaceModem *self,<br>
>      interface_initialization_step (ctx);<br>
>  }<br>
><br>
> +/*****************************************************************************/<br>
> +/* Setup SIM hot swap (Modem interface) */<br>
> +static void<br>
> +setup_sim_hot_swap_ready (MMIfaceModem *self,<br>
> +                          GAsyncResult *res,<br>
> +                          InitializationContext *ctx) {<br>
> +    GError *error = NULL;<br>
> +<br>
> +    MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap_finish (self, res, &error);<br>
> +    if (error) {<br>
> +        mm_warn ("Iface modem: SIM hot swap setup failed: '%s'", error->message);<br>
> +        g_error_free (error);<br>
> +    } else {<br>
> +        mm_dbg ("Iface modem: SIM hot swap setup succeded");<br>
> +    }<br>
> +<br>
> +    /* Go on to next step */<br>
> +    ctx->step++;<br>
> +    interface_initialization_step (ctx);<br>
> +}<br>
> +<br>
>  static void<br>
>  interface_initialization_step (InitializationContext *ctx)<br>
>  {<br>
> @@ -4544,6 +4566,18 @@ interface_initialization_step (InitializationContext *ctx)<br>
>          /* Fall down to next step */<br>
>          ctx->step++;<br>
><br>
> +    case INITIALIZATION_STEP_SIM_HOT_SWAP:<br>
> +        if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_sim_hot_swap &&<br>
> +            MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_sim_hot_swap_finish) {<br>
> +            MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_sim_hot_swap (<br>
> +                MM_IFACE_MODEM (ctx->self),<br>
> +                (GAsyncReadyCallback) setup_sim_hot_swap_ready,<br>
> +                ctx);<br>
> +                return;<br>
> +        }<br>
> +        /* Fall down to next step */<br>
> +        ctx->step++;<br>
> +<br>
>      case INITIALIZATION_STEP_UNLOCK_REQUIRED:<br>
>          /* Only check unlock required if we were previously not unlocked */<br>
>          if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE) {<br>
> @@ -4707,6 +4741,21 @@ interface_initialization_step (InitializationContext *ctx)<br>
>                            ctx->self);<br>
><br>
>          if (ctx->fatal_error) {<br>
> +            if (g_error_matches (ctx->fatal_error,<br>
> +                                 MM_MOBILE_EQUIPMENT_ERROR,<br>
> +                                 MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED)) {<br>
> +                gboolean is_sim_hot_swap_supported = FALSE;<br>
> +<br>
> +                g_object_get (ctx->self,<br>
> +                              MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED,<br>
> +                              &is_sim_hot_swap_supported,<br>
> +                              NULL);<br>
> +<br>
> +                if (is_sim_hot_swap_supported) {<br>
> +                    mm_iface_modem_update_failed_state (ctx->self,<br>
> +                                                        MM_MODEM_STATE_FAILED_REASON_SIM_MISSING);<br>
> +                }<br>
> +            }<br>
>              g_simple_async_result_take_error (ctx->result, ctx->fatal_error);<br>
>              ctx->fatal_error = NULL;<br>
>          } else {<br>
> @@ -5119,6 +5168,13 @@ iface_modem_init (gpointer g_iface)<br>
>                                "List of bearers handled by the modem",<br>
>                                MM_TYPE_BEARER_LIST,<br>
>                                G_PARAM_READWRITE));<br>
> +    g_object_interface_install_property<br>
> +        (g_iface,<br>
> +         g_param_spec_boolean (MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED,<br>
> +                               "Sim Hot Swap Supported",<br>
> +                               "Whether the modem supports sim hot swap or not.",<br>
> +                               FALSE,<br>
> +                               G_PARAM_READWRITE));<br>
><br>
>      initialized = TRUE;<br>
>  }<br>
> diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h<br>
> index 74ea9f9..517c651 100644<br>
> --- a/src/mm-iface-modem.h<br>
> +++ b/src/mm-iface-modem.h<br>
> @@ -32,10 +32,11 @@<br>
>  #define MM_IS_IFACE_MODEM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM))<br>
>  #define MM_IFACE_MODEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM, MMIfaceModem))<br>
><br>
> -#define MM_IFACE_MODEM_DBUS_SKELETON "iface-modem-dbus-skeleton"<br>
> -#define MM_IFACE_MODEM_STATE         "iface-modem-state"<br>
> -#define MM_IFACE_MODEM_SIM           "iface-modem-sim"<br>
> -#define MM_IFACE_MODEM_BEARER_LIST   "iface-modem-bearer-list"<br>
> +#define MM_IFACE_MODEM_DBUS_SKELETON           "iface-modem-dbus-skeleton"<br>
> +#define MM_IFACE_MODEM_STATE                   "iface-modem-state"<br>
> +#define MM_IFACE_MODEM_SIM                     "iface-modem-sim"<br>
> +#define MM_IFACE_MODEM_BEARER_LIST             "iface-modem-bearer-list"<br>
> +#define MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED  "iface-modem-sim-hot-swap-supported"<br>
><br>
>  typedef struct _MMIfaceModem MMIfaceModem;<br>
><br>
> @@ -327,6 +328,14 @@ struct _MMIfaceModem {<br>
>      MMBaseBearer * (*create_bearer_finish) (MMIfaceModem *self,<br>
>                                              GAsyncResult *res,<br>
>                                              GError **error);<br>
> +    /* Setup SIM hot swap */<br>
> +    void (*setup_sim_hot_swap) (MMIfaceModem *self,<br>
> +                                GAsyncReadyCallback callback,<br>
> +                                gpointer user_data);<br>
> +<br>
> +    gboolean (*setup_sim_hot_swap_finish) (MMIfaceModem *self,<br>
> +                                            GAsyncResult *res,<br>
> +                                            GError **error);<br>
>  };<br>
><br>
>  GType mm_iface_modem_get_type (void);<br>
> --<br>
> 2.7.4<br>
><br>
> _______________________________________________<br>
> ModemManager-devel mailing list<br>
> <a href="mailto:ModemManager-devel@lists.freedesktop.org" target="_blank">ModemManager-devel@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel</a><br>
<br>
<br>
<br>
--<br>
Aleksander<br>
<a href="https://aleksander.es" rel="noreferrer" target="_blank">https://aleksander.es</a><br>
</blockquote></div>