aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-12-11 15:19:27 -0600
committerDan Williams <dcbw@redhat.com>2012-12-13 10:35:21 -0600
commit38f9f1ce670748a359cbab16d9f8540573760afb (patch)
tree888d1bba3b2937613415d46b076393a067af0ed5
parent780fadd71e39518cea20aea3fd9e2b56b6eba506 (diff)
sierra: restore longer CFUN=1 timeout for older devices
Turns out older devices (like the C885/AT&T Mercury) crash often when we don't wait for them to settle from CFUN=1. 5 seconds is too short, but the crashes go away when we wait for 10 seconds. Newer modems like the USB306 don't have this problem, so we just check to see if the modem is a DirectIP device (using sierra_net) and only use the shorter timeout for those newer devices. This is a separate problem from some older modems returning ERROR to valid commands that are sent too soon after CFUN=1, which was observed on really old devices like the PCMCIA 860. (backport of commit 5427f0d356c115814562cbe0483157a62de616cb)
-rw-r--r--plugins/mm-modem-sierra-gsm.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/mm-modem-sierra-gsm.c b/plugins/mm-modem-sierra-gsm.c
index 83aafab3..e9098b37 100644
--- a/plugins/mm-modem-sierra-gsm.c
+++ b/plugins/mm-modem-sierra-gsm.c
@@ -582,7 +582,7 @@ real_do_enable_power_up_done (MMGenericGsm *gsm,
{
MMModemSierraGsmPrivate *priv = MM_MODEM_SIERRA_GSM_GET_PRIVATE (gsm);
char *driver = NULL;
- guint seconds = 5;
+ guint seconds = 10;
if (error) {
/* Chain up to parent */
@@ -599,17 +599,17 @@ real_do_enable_power_up_done (MMGenericGsm *gsm,
return;
}
- /* Most Sierra devices return OK immediately in response to CFUN=1 but
- * need some time to finish powering up.
+ /* Many Sierra devices return OK immediately in response to CFUN=1 but
+ * need some time to finish powering up, otherwise subsequent commands
+ * may return failure or even crash the modem. Give more time for older
+ * devices like the AC860 and C885, which aren't driven by the 'sierra_net'
+ * driver. Assume any DirectIP (ie, sierra_net) device is new enough
+ * to allow a lower timeout.
*/
g_warn_if_fail (priv->enable_wait_id == 0);
g_object_get (G_OBJECT (gsm), MM_MODEM_DRIVER, &driver, NULL);
- if (g_strcmp0 (driver, "sierra") != 0) {
- /* more time for older devices like the AC860, which aren't driven
- * by the 'sierra' driver.
- */
- seconds = 10;
- }
+ if (g_strcmp0 (driver, "sierra_net") == 0)
+ seconds = 5;
priv->enable_wait_id = g_timeout_add_seconds (seconds, sierra_enabled, info);
}