summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenhua Zhang <zhenhua.zhang@intel.com>2010-07-28 08:25:26 +0800
committerDenis Kenzior <denkenz@gmail.com>2010-08-02 14:10:37 -0500
commit26efde3d7b33e8332f56fe6a741ddea99a0e8b84 (patch)
treefbf85581209082072e34ca4b1030f8267f2554da
parentb952c34c38f6dfe82c035384585bbf2d9ee43667 (diff)
downloadofono-26efde3d7b33e8332f56fe6a741ddea99a0e8b84.tar.bz2
Fix busylooped in ppp_disconnect for huawei modem
Huawei modem closes the modem port after PPP disconnect. So the channel of gatchat is NULL in ppp_disconnect. In such case, we resume the chat and it causes huawei_disconnect() get called and the gprs context is removed later. Before removing this gprs context, we should reply the pending DBus message to the client.
-rw-r--r--drivers/atmodem/gprs-context.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
index fea80b00..65895607 100644
--- a/drivers/atmodem/gprs-context.c
+++ b/drivers/atmodem/gprs-context.c
@@ -93,7 +93,6 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
g_at_ppp_unref(gcd->ppp);
gcd->ppp = NULL;
- g_at_chat_resume(gcd->chat);
switch (gcd->state) {
case STATE_ENABLING:
@@ -110,6 +109,12 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
gcd->active_context = 0;
gcd->state = STATE_IDLE;
+ /*
+ * If the channel of gcd->chat is NULL, it might cause
+ * gprs_context_remove get called and the gprs context will be
+ * removed.
+ */
+ g_at_chat_resume(gcd->chat);
}
static gboolean setup_ppp(struct ofono_gprs_context *gc)
@@ -257,7 +262,7 @@ static void at_gprs_context_remove(struct ofono_gprs_context *gc)
DBG("");
- if (gcd->state != STATE_IDLE) {
+ if (gcd->state != STATE_IDLE && gcd->ppp) {
g_at_ppp_unref(gcd->ppp);
g_at_chat_resume(gcd->chat);
}