diff options
author | Dan Williams <dcbw@redhat.com> | 2012-06-06 11:40:47 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-06-06 11:44:50 -0500 |
commit | 7dd42f1982720dd666bc4d7a4920f033bcf64662 (patch) | |
tree | 7766ada706be5822bb5592cc8c42a52ef1145698 | |
parent | 57edab2dc0df8b52c406d6010fd4756c8812c43c (diff) |
zte: try to handle Icera devices that use PPP
Not all devices present a network interface, and on these devices
we need to fall back to PPP using the standard setup commands. But
they appear to support the Icera custom commands for access technology
and such, so still use those.
Hopefully fixes ZTE MF665C.
-rw-r--r-- | plugins/mm-modem-zte.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/plugins/mm-modem-zte.c b/plugins/mm-modem-zte.c index 88ef7344..d089f351 100644 --- a/plugins/mm-modem-zte.c +++ b/plugins/mm-modem-zte.c @@ -47,6 +47,7 @@ typedef struct { gboolean init_retried; guint32 cpms_tries; guint cpms_timeout; + gboolean has_net; gboolean is_icera; MMModemIceraPrivate *icera; } MMModemZtePrivate; @@ -328,7 +329,7 @@ do_disconnect (MMGenericGsm *gsm, MMModemZte *self = MM_MODEM_ZTE (gsm); MMModemZtePrivate *priv = MM_MODEM_ZTE_GET_PRIVATE (self); - if (priv->is_icera) + if (priv->is_icera && priv->has_net) mm_modem_icera_do_disconnect (gsm, cid, callback, user_data); else MM_GENERIC_GSM_CLASS (mm_modem_zte_parent_class)->do_disconnect (gsm, cid, callback, user_data); @@ -435,9 +436,16 @@ icera_check_cb (MMModem *modem, if (result) { priv->is_icera = TRUE; - g_object_set (G_OBJECT (modem), - MM_MODEM_IP_METHOD, MM_MODEM_IP_METHOD_STATIC, - NULL); + + /* Some devices with Icera chipsets don't have pseudo-ethernet + * ports and thus should use PPP. Some devices use static IP, + * while others use DHCP on the net port. What fun. + */ + if (priv->has_net) { + g_object_set (G_OBJECT (modem), + MM_MODEM_IP_METHOD, MM_MODEM_IP_METHOD_STATIC, + NULL); + } } } } @@ -574,8 +582,9 @@ do_connect (MMModem *modem, gpointer user_data) { MMModem *parent_iface; + MMModemZtePrivate *priv = MM_MODEM_ZTE_GET_PRIVATE (modem); - if (MM_MODEM_ZTE_GET_PRIVATE (modem)->is_icera) + if (priv->is_icera && priv->has_net) mm_modem_icera_do_connect (MM_MODEM_ICERA (modem), number, callback, user_data); else { parent_iface = g_type_interface_peek_parent (MM_MODEM_GET_INTERFACE (modem)); @@ -672,7 +681,8 @@ grab_port (MMModem *modem, /* Add Icera-specific handlers */ mm_modem_icera_register_unsolicted_handlers (MM_MODEM_ICERA (gsm), MM_AT_SERIAL_PORT (port)); - } + } else if (port && (mm_port_get_subsys (port) == MM_PORT_SUBSYS_NET)) + MM_MODEM_ZTE_GET_PRIVATE (gsm)->has_net = TRUE; return !!port; } |