authorAleksander Morgado <>2012-11-08 14:59:12 (GMT)
committer Aleksander Morgado <>2012-11-12 08:49:48 (GMT)
commitc2db8abe5238c3ddd05d11a0f99f10914b2af9cf (patch) (side-by-side diff)
parent8c4a836a2dbb9f682ab99871496c47a4c899ded9 (diff)
huawei: better detection of data port on some modems
Some devices (e173) appear to lie about NDIS support; GETPORTMODE reports NDIS is enabled, but that port is actually the MDM port and responds to AT commands. So, if we get a port reported as NDIS and none reported as MDM, use the one reported as NDIS for PPP.
Diffstat (more/less context) (ignore whitespace changes)
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/huawei/mm-plugin-huawei.c b/plugins/huawei/mm-plugin-huawei.c
index 428ece5..213ff40 100644
--- a/plugins/huawei/mm-plugin-huawei.c
+++ b/plugins/huawei/mm-plugin-huawei.c
@@ -63,6 +63,7 @@ first_interface_context_free (FirstInterfaceContext *ctx)
#define TAG_HUAWEI_PCUI_PORT "huawei-pcui-port"
#define TAG_HUAWEI_MODEM_PORT "huawei-modem-port"
+#define TAG_HUAWEI_NDIS_PORT "huawei-ndis-port"
#define TAG_HUAWEI_DIAG_PORT "huawei-diag-port"
#define TAG_GETPORTMODE_SUPPORTED "getportmode-supported"
#define TAG_AT_PORT_FLAGS "at-port-flags"
@@ -152,6 +153,7 @@ getportmode_ready (MMAtSerialPort *port,
device = mm_port_probe_peek_device (ctx->probe);
cache_port_mode (device, response->str, "PCUI:", TAG_HUAWEI_PCUI_PORT);
cache_port_mode (device, response->str, "MDM:", TAG_HUAWEI_MODEM_PORT);
+ cache_port_mode (device, response->str, "NDIS:", TAG_HUAWEI_NDIS_PORT);
cache_port_mode (device, response->str, "DIAG:", TAG_HUAWEI_DIAG_PORT);
@@ -403,6 +405,10 @@ propagate_port_mode_results (GList *probes)
at_port_flags = MM_AT_PORT_FLAG_PRIMARY;
else if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_MODEM_PORT)))
at_port_flags = MM_AT_PORT_FLAG_PPP;
+ else if (!g_object_get_data (G_OBJECT (device), TAG_HUAWEI_MODEM_PORT) &&
+ usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_NDIS_PORT)))
+ /* If NDIS reported only instead of MDM, use it */
+ at_port_flags = MM_AT_PORT_FLAG_PPP;
} else if (usbif == 0 &&
mm_port_probe_is_at (MM_PORT_PROBE (l->data))) {
/* If GETPORTMODE is not supported, we assume usbif 0 is the modem port */