[PATCH 1/3] altair-lte: reference the secondary port in DetailedConnectContext

Aleksander Morgado aleksander at aleksander.es
Fri Jan 3 03:26:48 PST 2014


On 03/01/14 01:00, Ben Chan wrote:
> ---
>  plugins/altair/mm-broadband-bearer-altair-lte.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>

What's the purpose of keeping a reference to the secondary port around
if it is not going to be used during the connection sequence?



> diff --git a/plugins/altair/mm-broadband-bearer-altair-lte.c b/plugins/altair/mm-broadband-bearer-altair-lte.c
> index 88cb46c..98c8193 100644
> --- a/plugins/altair/mm-broadband-bearer-altair-lte.c
> +++ b/plugins/altair/mm-broadband-bearer-altair-lte.c
> @@ -45,6 +45,7 @@ typedef struct {
>      MMBroadbandBearerAltairLte *self;
>      MMBaseModem *modem;
>      MMAtSerialPort *primary;
> +    MMAtSerialPort *secondary;
>      MMPort *data;
>      GCancellable *cancellable;
>      GSimpleAsyncResult *result;
> @@ -54,6 +55,7 @@ static DetailedConnectContext *
>  detailed_connect_context_new (MMBroadbandBearer *self,
>                                MMBroadbandModem *modem,
>                                MMAtSerialPort *primary,
> +                              MMAtSerialPort *secondary,
>                                MMPort *data,
>                                GCancellable *cancellable,
>                                GAsyncReadyCallback callback,
> @@ -65,6 +67,7 @@ detailed_connect_context_new (MMBroadbandBearer *self,
>      ctx->self = g_object_ref (self);
>      ctx->modem = MM_BASE_MODEM (g_object_ref (modem));
>      ctx->primary = g_object_ref (primary);
> +    ctx->secondary = (secondary ? g_object_ref (secondary) : NULL);
>      ctx->data = data;
>      /* NOTE:
>       * We don't currently support cancelling AT commands, so we'll just check
> @@ -85,6 +88,8 @@ detailed_connect_context_complete_and_free (DetailedConnectContext *ctx)
>      g_object_unref (ctx->cancellable);
>      if (ctx->data)
>          g_object_unref (ctx->data);
> +    if (ctx->secondary)
> +        g_object_unref (ctx->secondary);
>      g_object_unref (ctx->primary);
>      g_object_unref (ctx->modem);
>      g_object_unref (ctx->self);
> @@ -202,6 +207,7 @@ connect_3gpp (MMBroadbandBearer *self,
>          self,
>          modem,
>          primary,
> +        secondary,
>          /* Get a 'net' data port */
>          mm_base_modem_get_best_data_port (MM_BASE_MODEM (modem),
>                                            MM_PORT_TYPE_NET),
> 


-- 
Aleksander Morgado
http://aleksander.es


More information about the ModemManager-devel mailing list