port-probe: Increase AT probe command timeout to 7 seconds for altair.
This patch increases the response timeout for the probe AT commands for
altair modems.
We've been noticing some altair modems taking upto 6 seconds to respond to the
initial probe command after a reset which results in modem-manager
timing out and sending a second probe command. The modem sends a response
after about 6 seconds for the initial probe command which modem-manager
treats as response to second probe command and this results in the
modem-manager and modem going out of sync because the modem's second
probe response is treated as response to the next initialization AT command
sent by modem-manager and so on.
BUG=chrome-os-partner:33718
TEST='test_that ${host} network_3GModemPresent'
Change-Id: Iad8b0786327b153fd95c8ee4516f352325a42cf7
Reviewed-on: https://chromium-review.googlesource.com/239960
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Roshan Pius <rpius@chromium.org>
Tested-by: Roshan Pius <rpius@chromium.org>
diff --git a/plugins/altair/mm-plugin-altair-lte.c b/plugins/altair/mm-plugin-altair-lte.c
index 1e1ecef..4201548 100644
--- a/plugins/altair/mm-plugin-altair-lte.c
+++ b/plugins/altair/mm-plugin-altair-lte.c
@@ -34,6 +34,21 @@
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
+/*****************************************************************************/
+/* Custom commands for AT probing */
+
+/* Increase the response timeout for probe commands since some altair modems
+ take longer to respond after a reset.
+ */
+static const MMPortProbeAtCommand custom_at_probe[] = {
+ { "AT", 7, mm_port_probe_response_processor_is_at },
+ { "AT", 7, mm_port_probe_response_processor_is_at },
+ { "AT", 7, mm_port_probe_response_processor_is_at },
+ { NULL }
+};
+
+/*****************************************************************************/
+
static MMBaseModem *
create_modem (MMPlugin *self,
const gchar *sysfs_path,
@@ -65,6 +80,7 @@
MM_PLUGIN_NAME, "Altair LTE",
MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_ALLOWED_PRODUCT_IDS, products,
+ MM_PLUGIN_CUSTOM_AT_PROBE, custom_at_probe,
MM_PLUGIN_ALLOWED_SINGLE_AT, TRUE,
MM_PLUGIN_SEND_LF, TRUE,
NULL));