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.
This commit is contained in:
Dan Williams
2013-04-19 16:24:17 -05:00
parent aa4fd7c421
commit 60845f10c9
+27 -2
View File
@@ -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;
}