From 232d4d4aaed69d7e0cdb75c19d0af2fd86c9469a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 26 Jan 2016 12:46:09 -0600 Subject: [PATCH] broadband-bearer: don't send disconnect CGACT on data port for multi-port modems A Huawei E173 (with FW 11.126.15.00.445) seems to stop responding on the primary port (ttyUSB2) when the CGACT is resent on the data port (ttyUSB0). The CGACT-on-data-port was originally added as a fallback attempt to get single-port modems to disconnect when all other methods failed. For single-port modems, the primary port is also the data port so this patch will have no effect. For multi-port modems, this patch will retry the CGACT on the primary port which has a higher chance of success because we already know the primary port is talking to us, while the data port may still be stuck in PPP mode. --- src/mm-broadband-bearer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index d917542a..d8c8c884 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -1511,10 +1511,18 @@ data_flash_3gpp_ready (MMPortSerial *data, return; } - /* Last resort, try to send CGACT in the data port itself */ - mm_dbg ("Sending PDP context deactivation in data port..."); + /* Send another CGACT on the primary port (also the data port when the modem + * only has one serial port) if the previous one failed. Some modems, like + * the Huawei E173 (fw 11.126.15.00.445) stop responding on their primary + * port when the CGACT is sent on the separte data port. + */ + if (MM_PORT_SERIAL (ctx->primary) == data) + mm_dbg ("Sending PDP context deactivation in primary/data port..."); + else + mm_dbg ("Sending PDP context deactivation in primary port again..."); + mm_base_modem_at_command_full (ctx->modem, - MM_PORT_SERIAL_AT (data), + ctx->primary, ctx->cgact_command, 10, FALSE,