summaryrefslogtreecommitdiffstats
path: root/drivers/atmodem/gprs-context.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2011-08-05 22:50:21 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-08-05 22:50:21 +0200
commit63e8118eeef3c266e6dfb9095192e98462531023 (patch)
tree5221c2652644cd0b84f32c3f5e148c16f9db7d7d /drivers/atmodem/gprs-context.c
parentbb227dbe3342e1e2fbb3bf84cb093ab73eb4b658 (diff)
downloadofono-63e8118eeef3c266e6dfb9095192e98462531023.tar.bz2
atmodem: Add funny ZTE quirk for GPRS context support
Diffstat (limited to 'drivers/atmodem/gprs-context.c')
-rw-r--r--drivers/atmodem/gprs-context.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
index c5dabf24..cf80d5bf 100644
--- a/drivers/atmodem/gprs-context.c
+++ b/drivers/atmodem/gprs-context.c
@@ -241,6 +241,27 @@ static void at_gprs_activate_primary(struct ofono_gprs_context *gc,
gcd->state = STATE_ENABLING;
+ if (gcd->vendor == OFONO_VENDOR_ZTE) {
+ GAtChat *chat = g_at_chat_get_slave(gcd->chat);
+
+ /*
+ * The modem port of ZTE devices with certain firmware
+ * versions ends up getting suspended. It will no longer
+ * signal POLLOUT and becomes pretty unresponsive.
+ *
+ * To wake up the modem port, the only reliable method
+ * found so far is AT+ZOPRT power mode command. It is
+ * enough to ask for the current mode and the modem
+ * port wakes up and accepts commands again.
+ *
+ * And since the modem port is suspended, this command
+ * needs to be send on the control port of course.
+ *
+ */
+ g_at_chat_send(chat, "AT+ZOPRT?", none_prefix,
+ NULL, NULL, NULL);
+ }
+
len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid);
if (ctx->apn)