summaryrefslogtreecommitdiffstats
path: root/drivers/mbmmodem
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-02-05 12:20:45 -0600
committerDenis Kenzior <denkenz@gmail.com>2010-02-05 12:20:45 -0600
commitbfeef21a9dffd14d2f01f878daa0969b02e0b9e4 (patch)
tree35a003dafb37930bcc708c921611ce2c5882b133 /drivers/mbmmodem
parent8268c4fe62b723112b66100d1f7a4c24367c3fc4 (diff)
downloadofono-bfeef21a9dffd14d2f01f878daa0969b02e0b9e4.tar.bz2
Fix: Send *EIAAUW after CGDCONT for STE and MBM
Otherwise the EIAAUW might fail.
Diffstat (limited to 'drivers/mbmmodem')
-rw-r--r--drivers/mbmmodem/gprs-context.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/mbmmodem/gprs-context.c b/drivers/mbmmodem/gprs-context.c
index 3e7a75bf..dfc905ac 100644
--- a/drivers/mbmmodem/gprs-context.c
+++ b/drivers/mbmmodem/gprs-context.c
@@ -350,13 +350,6 @@ static void mbm_gprs_activate_primary(struct ofono_gprs_context *gc,
cbd->user = gc;
- snprintf(buf, sizeof(buf), "AT*EIAAUW=%d,1,\"%s\",\"%s\"",
- ctx->cid, ctx->username, ctx->password);
-
- if (g_at_chat_send(gcd->chat, buf, none_prefix,
- NULL, NULL, NULL) == 0)
- goto error;
-
len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid);
if (ctx->apn)
@@ -364,8 +357,21 @@ static void mbm_gprs_activate_primary(struct ofono_gprs_context *gc,
ctx->apn);
if (g_at_chat_send(gcd->chat, buf, none_prefix,
- mbm_cgdcont_cb, cbd, g_free) > 0)
- return;
+ mbm_cgdcont_cb, cbd, g_free) == 0)
+ goto error;
+
+ /*
+ * Set username and password, this should be done after CGDCONT
+ * or an error can occur. We don't bother with error checking
+ * here
+ * */
+ snprintf(buf, sizeof(buf), "AT*EIAAUW=%d,1,\"%s\",\"%s\"",
+ ctx->cid, ctx->username, ctx->password);
+
+ g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL);
+
+ return;
+
error:
if (cbd)
g_free(cbd);