All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH_v2] atmodem: Fix crash on context activation.
@ 2012-04-16 13:09 Guillaume Zajac
  2012-05-10 15:43 ` Guillaume Zajac
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Zajac @ 2012-04-16 13:09 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

Shutdown PPP session if modem did not do it.
---
 drivers/atmodem/gprs-context.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
index 16893ce..100c80b 100644
--- a/drivers/atmodem/gprs-context.c
+++ b/drivers/atmodem/gprs-context.c
@@ -239,6 +239,17 @@ static void at_gprs_activate_primary(struct ofono_gprs_context *gc,
 	memcpy(gcd->username, ctx->username, sizeof(ctx->username));
 	memcpy(gcd->password, ctx->password, sizeof(ctx->password));
 
+	/*
+	 * For some modem, mainly Huawei branded, when GPRS is no more attached
+	 * to the network, oFono core will reset context although the modem
+	 * has not ended ppp sesssion at driver level.
+	 * In this case trigger a disconnection manually and send an error.
+	 */
+	if (gcd->ppp != NULL && gcd->state == STATE_ACTIVE) {
+		g_at_ppp_shutdown(gcd->ppp);
+		goto error;
+	}
+
 	gcd->state = STATE_ENABLING;
 
 	if (gcd->vendor == OFONO_VENDOR_ZTE) {
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-10 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-16 13:09 [PATCH_v2] atmodem: Fix crash on context activation Guillaume Zajac
2012-05-10 15:43 ` Guillaume Zajac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.