From 63e8118eeef3c266e6dfb9095192e98462531023 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Aug 2011 22:50:21 +0200 Subject: [PATCH] atmodem: Add funny ZTE quirk for GPRS context support --- drivers/atmodem/gprs-context.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c index c5dabf2..cf80d5b 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) -- 2.7.4