[PATCH] iface-modem: allow setting power state to OFF when modem is in FAILED state

Aleksander Morgado aleksander at aleksander.es
Mon Mar 3 00:45:07 PST 2014


On Fri, Feb 28, 2014 at 9:30 PM, Ben Chan <benchan at chromium.org> wrote:
> ---
>  src/mm-iface-modem.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
> index c024197..c3cb2a8 100644
> --- a/src/mm-iface-modem.c
> +++ b/src/mm-iface-modem.c
> @@ -4667,6 +4667,15 @@ interface_initialization_step (InitializationContext *ctx)
>                            "handle-set-current-capabilities",
>                            G_CALLBACK (handle_set_current_capabilities),
>                            ctx->self);
> +        /* Allow setting the power state to OFF even when the modem is in the
> +         * FAILED state as this operation does not necessarily depend on the
> +         * presence of a SIM. handle_set_power_state_auth_ready already ensures
> +         * that the power state can only be set to OFF when the modem is in the
> +         * FAILED state. */
> +        g_signal_connect (ctx->skeleton,
> +                          "handle-set-power-state",
> +                          G_CALLBACK (handle_set_power_state),
> +                          ctx->self);
>          /* Allow the reset and factory reset operation in FAILED state to rescue the modem.
>           * Also, for a modem that doesn't support SIM hot swapping, a reset is needed to
>           * force the modem to detect the newly inserted SIM. */
> @@ -4706,10 +4715,6 @@ interface_initialization_step (InitializationContext *ctx)
>                                G_CALLBACK (handle_enable),
>                                ctx->self);
>              g_signal_connect (ctx->skeleton,
> -                              "handle-set-power-state",
> -                              G_CALLBACK (handle_set_power_state),
> -                              ctx->self);
> -            g_signal_connect (ctx->skeleton,
>                                "handle-set-current-bands",
>                                G_CALLBACK (handle_set_current_bands),
>                                ctx->self);
> --
> 1.9.0.279.gdc9e3eb
>

Doing this would also allow trying to set ON and LOW power states
while in Failed state. How about also modifying the power setting
logic itself so that only OFF is allowed while in Failed state?

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list