aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2016-01-26 12:46:09 -0600
committerDan Williams <dcbw@redhat.com>2016-02-11 10:46:17 -0600
commit232d4d4aaed69d7e0cdb75c19d0af2fd86c9469a (patch)
tree1a618eb46a21d4bbe05cdb7692b8131d81659337
parent504f422ddd99848adba2a85055f2ce33c0fbb612 (diff)
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.
-rw-r--r--src/mm-broadband-bearer.c14
1 files 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,