atmodem: Add gprs-context quirk for HUAWEI vendor

When ofono dies while connected using PPP, modem AT channel is not put
back to command mode (tested with HUAWEI modems E3372 and MS2372).
If ofono is restarted, it won't be able to connect as it gets no answer
to AT commands on this AT channel.
This patch adds a quirk to immediately send escape sequence on modem
channel when gprs-context atom is removed.
This commit is contained in:
Christophe Ronco 2018-07-25 15:45:13 +02:00 committed by Denis Kenzior
parent 376af6c85c
commit 527e6b1f86
1 changed files with 9 additions and 0 deletions

View File

@ -461,10 +461,19 @@ static int at_gprs_context_probe(struct ofono_gprs_context *gc,
static void at_gprs_context_remove(struct ofono_gprs_context *gc)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
GAtIO *io;
DBG("");
if (gcd->state != STATE_IDLE && gcd->ppp) {
if ((gcd->vendor == OFONO_VENDOR_HUAWEI) && gcd->chat) {
/* immediately send escape sequence */
io = g_at_chat_get_io(gcd->chat);
if (io)
g_at_io_write(io, "+++", 3);
}
g_at_ppp_unref(gcd->ppp);
g_at_chat_resume(gcd->chat);
}