From ab7f558a2c6376396c021d57175c6faaba57554c Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 31 Aug 2012 13:21:35 +0200 Subject: [PATCH] zte: handle Icera-based devics that use DHCP This is the port to git master of the following commit: commit d2654a287c309346cc46b535dd974b0a5fc06fd4 Author: Dan Williams Date: Tue Aug 28 12:15:30 2012 -0500 zte: handle Icera-based devics that use DHCP Since we can't autodetect that the devices use DHCP, we'll need to tag them with udev rules for the time being. --- plugins/zte/77-mm-zte-port-types.rules | 3 +++ plugins/zte/mm-plugin-zte.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/plugins/zte/77-mm-zte-port-types.rules b/plugins/zte/77-mm-zte-port-types.rules index ac008dd7..6fcbbf2f 100644 --- a/plugins/zte/77-mm-zte-port-types.rules +++ b/plugins/zte/77-mm-zte-port-types.rules @@ -183,5 +183,8 @@ ATTRS{idProduct}=="2002", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}= ATTRS{idProduct}=="2003", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" ATTRS{idProduct}=="2003", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +# Icera-based devices that use DHCP, not AT%IPDPADDR +ATTRS{product}=="K3805-z", ENV{ID_MM_ZTE_ICERA_DHCP}="1" + LABEL="mm_zte_port_types_end" diff --git a/plugins/zte/mm-plugin-zte.c b/plugins/zte/mm-plugin-zte.c index 739393c6..241e5b2c 100644 --- a/plugins/zte/mm-plugin-zte.c +++ b/plugins/zte/mm-plugin-zte.c @@ -92,6 +92,13 @@ grab_port (MMPlugin *self, pflags = MM_AT_PORT_FLAG_SECONDARY; } + if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_ICERA_DHCP")) { + mm_dbg ("Icera-based ZTE modem will use DHCP"); + g_object_set (modem, + MM_BROADBAND_MODEM_ICERA_DEFAULT_IP_METHOD, MM_BEARER_IP_METHOD_DHCP, + NULL); + } + return mm_base_modem_grab_port (modem, mm_port_probe_get_port_subsys (probe), mm_port_probe_get_port_name (probe),