aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-04-19 16:24:17 -0500
committerDan Williams <dcbw@redhat.com>2013-04-19 16:24:17 -0500
commit60845f10c9dae6c7e53022050aa8d09e1e1354ea (patch)
tree22430e51cdeebff0428a0393999a14b7d2d70699
parentaa4fd7c421776c33f0955517eb441fa2a14d6401 (diff)
broadband-modem-qmi: work around old Gobi 1K firmware SetDataFormat issue
It seems that really old Gobi 1K firmware (from ~2008) doesn't implement the SetDataFormat command, and will simply ignore the request without replying to it. But the device works just fine if we retry the QMI port open operation without the SetDataFormat request. The downside of this is is that on older kernels, the qmi_wwan driver won't automatically fix up any raw-ip packets it receives, but the old Gobi devices don't ever send raw-ip packets anyway, so it's not a problem.
-rw-r--r--src/mm-broadband-modem-qmi.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index 50fa85a7..32a43473 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -7806,6 +7806,23 @@ allocate_next_client (InitializationStartedContext *ctx)
ctx);
}
+
+static void
+qmi_port_open_ready_no_data_format (MMQmiPort *qmi,
+ GAsyncResult *res,
+ InitializationStartedContext *ctx)
+{
+ GError *error = NULL;
+
+ if (!mm_qmi_port_open_finish (qmi, res, &error)) {
+ g_simple_async_result_take_error (ctx->result, error);
+ initialization_started_context_complete_and_free (ctx);
+ return;
+ }
+
+ allocate_next_client (ctx);
+}
+
static void
qmi_port_open_ready (MMQmiPort *qmi,
GAsyncResult *res,
@@ -7814,8 +7831,16 @@ qmi_port_open_ready (MMQmiPort *qmi,
GError *error = NULL;
if (!mm_qmi_port_open_finish (qmi, res, &error)) {
- g_simple_async_result_take_error (ctx->result, error);
- initialization_started_context_complete_and_free (ctx);
+ /* Really, really old devices (Gobi 1K, 2008-era firmware) may not
+ * support SetDataFormat, so if we get an error opening the port
+ * try without it. The qmi_wwan driver will fix up any issues that
+ * the device might have between raw-ip and 802.3 mode anyway.
+ */
+ mm_qmi_port_open (ctx->qmi,
+ FALSE,
+ NULL,
+ (GAsyncReadyCallback)qmi_port_open_ready_no_data_format,
+ ctx);
return;
}