diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-11-08 15:59:12 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-11-12 09:49:48 +0100 |
commit | c2db8abe5238c3ddd05d11a0f99f10914b2af9cf (patch) | |
tree | 1fcb85122eb480e623e5a25065d9bba550e9e6b8 | |
parent | 8c4a836a2dbb9f682ab99871496c47a4c899ded9 (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.
https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1057186
-rw-r--r-- | plugins/huawei/mm-plugin-huawei.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/huawei/mm-plugin-huawei.c b/plugins/huawei/mm-plugin-huawei.c index 428ece5a..213ff40c 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) | |||
63 | 63 | ||
64 | #define TAG_HUAWEI_PCUI_PORT "huawei-pcui-port" | 64 | #define TAG_HUAWEI_PCUI_PORT "huawei-pcui-port" |
65 | #define TAG_HUAWEI_MODEM_PORT "huawei-modem-port" | 65 | #define TAG_HUAWEI_MODEM_PORT "huawei-modem-port" |
66 | #define TAG_HUAWEI_NDIS_PORT "huawei-ndis-port" | ||
66 | #define TAG_HUAWEI_DIAG_PORT "huawei-diag-port" | 67 | #define TAG_HUAWEI_DIAG_PORT "huawei-diag-port" |
67 | #define TAG_GETPORTMODE_SUPPORTED "getportmode-supported" | 68 | #define TAG_GETPORTMODE_SUPPORTED "getportmode-supported" |
68 | #define TAG_AT_PORT_FLAGS "at-port-flags" | 69 | #define TAG_AT_PORT_FLAGS "at-port-flags" |
@@ -152,6 +153,7 @@ getportmode_ready (MMAtSerialPort *port, | |||
152 | device = mm_port_probe_peek_device (ctx->probe); | 153 | device = mm_port_probe_peek_device (ctx->probe); |
153 | cache_port_mode (device, response->str, "PCUI:", TAG_HUAWEI_PCUI_PORT); | 154 | cache_port_mode (device, response->str, "PCUI:", TAG_HUAWEI_PCUI_PORT); |
154 | cache_port_mode (device, response->str, "MDM:", TAG_HUAWEI_MODEM_PORT); | 155 | cache_port_mode (device, response->str, "MDM:", TAG_HUAWEI_MODEM_PORT); |
156 | cache_port_mode (device, response->str, "NDIS:", TAG_HUAWEI_NDIS_PORT); | ||
155 | cache_port_mode (device, response->str, "DIAG:", TAG_HUAWEI_DIAG_PORT); | 157 | cache_port_mode (device, response->str, "DIAG:", TAG_HUAWEI_DIAG_PORT); |
156 | g_object_set_data (G_OBJECT (device), TAG_GETPORTMODE_SUPPORTED, GUINT_TO_POINTER (TRUE)); | 158 | g_object_set_data (G_OBJECT (device), TAG_GETPORTMODE_SUPPORTED, GUINT_TO_POINTER (TRUE)); |
157 | 159 | ||
@@ -403,6 +405,10 @@ propagate_port_mode_results (GList *probes) | |||
403 | at_port_flags = MM_AT_PORT_FLAG_PRIMARY; | 405 | at_port_flags = MM_AT_PORT_FLAG_PRIMARY; |
404 | else if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_MODEM_PORT))) | 406 | else if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_MODEM_PORT))) |
405 | at_port_flags = MM_AT_PORT_FLAG_PPP; | 407 | at_port_flags = MM_AT_PORT_FLAG_PPP; |
408 | else if (!g_object_get_data (G_OBJECT (device), TAG_HUAWEI_MODEM_PORT) && | ||
409 | usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_NDIS_PORT))) | ||
410 | /* If NDIS reported only instead of MDM, use it */ | ||
411 | at_port_flags = MM_AT_PORT_FLAG_PPP; | ||
406 | } else if (usbif == 0 && | 412 | } else if (usbif == 0 && |
407 | mm_port_probe_is_at (MM_PORT_PROBE (l->data))) { | 413 | mm_port_probe_is_at (MM_PORT_PROBE (l->data))) { |
408 | /* If GETPORTMODE is not supported, we assume usbif 0 is the modem port */ | 414 | /* If GETPORTMODE is not supported, we assume usbif 0 is the modem port */ |