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 @@ -65,2 +65,3 @@ first_interface_context_free (FirstInterfaceContext *ctx) #define TAG_HUAWEI_MODEM_PORT "huawei-modem-port" +#define TAG_HUAWEI_NDIS_PORT "huawei-ndis-port" #define TAG_HUAWEI_DIAG_PORT "huawei-diag-port" @@ -154,2 +155,3 @@ getportmode_ready (MMAtSerialPort *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); @@ -405,2 +407,6 @@ propagate_port_mode_results (GList *probes) 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 && |