aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:18:41 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:53:26 +0100
commit93b4256fb6710de6cb10d22301aa902ba2456deb (patch)
tree6a38f4e9599bc132025bcb854e8881c3b8b9f76d /src
parent51956459dcf57ac0109ca0b8cc25d6fd927c2395 (diff)
broadband-bearer: pass down CID to the 3GPP-specific disconnection logic
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-bearer.c21
-rw-r--r--src/mm-broadband-bearer.h1
2 files changed, 11 insertions, 11 deletions
diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c
index 309fadd0..9a13d7f3 100644
--- a/src/mm-broadband-bearer.c
+++ b/src/mm-broadband-bearer.c
@@ -1448,9 +1448,6 @@ cgact_primary_ready (MMBaseModem *modem,
g_error_free (error);
}
- /* Clear CID if we got any set */
- if (ctx->self->priv->cid)
- ctx->self->priv->cid = 0;
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
detailed_disconnect_context_complete_and_free (ctx);
}
@@ -1482,9 +1479,6 @@ primary_flash_3gpp_ready (MMSerialPort *port,
/* Don't bother doing the CGACT again if it was done on a secondary port
* or if not needed */
if (ctx->cgact_sent) {
- /* Clear CID if we got any set */
- if (ctx->self->priv->cid)
- ctx->self->priv->cid = 0;
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
detailed_disconnect_context_complete_and_free (ctx);
return;
@@ -1533,6 +1527,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
MMAtSerialPort *primary,
MMAtSerialPort *secondary,
MMPort *data,
+ guint cid,
GAsyncReadyCallback callback,
gpointer user_data)
{
@@ -1549,10 +1544,9 @@ disconnect_3gpp (MMBroadbandBearer *self,
user_data);
/* If no specific CID was used, disable all PDP contexts */
- ctx->cgact_command =
- (MM_BROADBAND_BEARER (self)->priv->cid >= 0 ?
- g_strdup_printf ("+CGACT=0,%d", MM_BROADBAND_BEARER (self)->priv->cid) :
- g_strdup_printf ("+CGACT=0"));
+ ctx->cgact_command = (cid >= 0 ?
+ g_strdup_printf ("+CGACT=0,%d", cid) :
+ g_strdup_printf ("+CGACT=0"));
/* If the primary port is connected (with PPP) then try sending the PDP
* context deactivation on the secondary port because not all modems will
@@ -1663,8 +1657,12 @@ disconnect_3gpp_ready (MMBroadbandBearer *self,
res,
&error))
disconnect_failed (ctx, error);
- else
+ else {
+ /* Clear CID if we got any set */
+ if (ctx->self->priv->cid)
+ ctx->self->priv->cid = 0;
disconnect_succeeded (ctx);
+ }
}
static void
@@ -1723,6 +1721,7 @@ disconnect (MMBearer *self,
primary,
mm_base_modem_peek_port_secondary (modem),
MM_BROADBAND_BEARER (self)->priv->port,
+ MM_BROADBAND_BEARER (self)->priv->cid,
(GAsyncReadyCallback) disconnect_3gpp_ready,
ctx);
break;
diff --git a/src/mm-broadband-bearer.h b/src/mm-broadband-bearer.h
index 8c2b2ac7..5911a610 100644
--- a/src/mm-broadband-bearer.h
+++ b/src/mm-broadband-bearer.h
@@ -100,6 +100,7 @@ struct _MMBroadbandBearerClass {
MMAtSerialPort *primary,
MMAtSerialPort *secondary,
MMPort *data,
+ guint cid,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (* disconnect_3gpp_finish) (MMBroadbandBearer *self,