[Merge] lp:~phablet-team/network-manager/lp1418077 into lp:~network-manager/network-manager/ubuntu
Tony Espy
espy at canonical.com
Mon Apr 6 20:38:42 UTC 2015
AFAIK, we're not doing any more updates to the RTM branch. Also, pretty sure these diffs wouldn't apply as is...
Diff comments:
> === modified file 'debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch'
> --- debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch 2015-03-19 20:47:38 +0000
> +++ debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch 2015-04-06 17:56:32 +0000
> @@ -15,10 +15,10 @@
> create mode 100644 src/devices/wwan/nm-modem-ofono.c
> create mode 100644 src/devices/wwan/nm-modem-ofono.h
>
> -Index: b/configure.ac
> +Index: network-manager-0.9.10.0/configure.ac
> ===================================================================
> ---- a/configure.ac
> -+++ b/configure.ac
> +--- network-manager-0.9.10.0.orig/configure.ac
> ++++ network-manager-0.9.10.0/configure.ac
> @@ -593,6 +593,15 @@ else
> fi
> AM_CONDITIONAL(WITH_MODEM_MANAGER_1, test "${with_modem_manager_1}" = "yes")
> @@ -35,10 +35,10 @@
> # DHCP client support
> AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support]))
> AC_ARG_WITH([dhcpcd], AS_HELP_STRING([--with-dhcpcd=yes|no|path], [Enable dhcpcd 4.x support]))
> -Index: b/src/devices/wwan/Makefile.am
> +Index: network-manager-0.9.10.0/src/devices/wwan/Makefile.am
> ===================================================================
> ---- a/src/devices/wwan/Makefile.am
> -+++ b/src/devices/wwan/Makefile.am
> +--- network-manager-0.9.10.0.orig/src/devices/wwan/Makefile.am
> ++++ network-manager-0.9.10.0/src/devices/wwan/Makefile.am
> @@ -49,6 +49,13 @@ libnm_wwan_la_SOURCES += \
> nm-modem-broadband.h
> endif
> @@ -53,10 +53,10 @@
> WWAN_SYMBOL_VIS_FILE=$(srcdir)/wwan-exports.ver
>
> libnm_wwan_la_LDFLAGS = \
> -Index: b/src/devices/wwan/nm-modem-manager.c
> +Index: network-manager-0.9.10.0/src/devices/wwan/nm-modem-manager.c
> ===================================================================
> ---- a/src/devices/wwan/nm-modem-manager.c
> -+++ b/src/devices/wwan/nm-modem-manager.c
> +--- network-manager-0.9.10.0.orig/src/devices/wwan/nm-modem-manager.c
> ++++ network-manager-0.9.10.0/src/devices/wwan/nm-modem-manager.c
> @@ -17,7 +17,7 @@
> *
> * Copyright (C) 2009 - 2014 Red Hat, Inc.
> @@ -300,11 +300,11 @@
> #if WITH_MODEM_MANAGER_1
> /* ModemManager >= 0.7 */
> clear_modem_manager_1_support (self);
> -Index: b/src/devices/wwan/nm-modem-ofono.c
> +Index: network-manager-0.9.10.0/src/devices/wwan/nm-modem-ofono.c
> ===================================================================
> --- /dev/null
> -+++ b/src/devices/wwan/nm-modem-ofono.c
> -@@ -0,0 +1,1378 @@
> ++++ network-manager-0.9.10.0/src/devices/wwan/nm-modem-ofono.c
> +@@ -0,0 +1,1165 @@
> +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
> +/* NetworkManager -- Network link manager
> + *
> @@ -343,47 +343,6 @@
> +#include "nm-dbus-manager.h"
> +#include "NetworkManagerUtils.h"
> +
> -+typedef enum {
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_ANY = 0,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_GPRS,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_EDGE,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_UMTS,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSDPA,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_PREFERRED,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_PREFERRED,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_ONLY,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_ONLY,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSUPA,
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSPA,
> -+
> -+ MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_LAST = MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSPA
> -+} MMModemDeprecatedMode;
> -+
> -+typedef enum {
> -+ MM_MODEM_GSM_ALLOWED_MODE_ANY = 0,
> -+ MM_MODEM_GSM_ALLOWED_MODE_2G_PREFERRED = 1,
> -+ MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED = 2,
> -+ MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY = 3,
> -+ MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY = 4,
> -+ MM_MODEM_GSM_ALLOWED_MODE_4G_PREFERRED = 5,
> -+ MM_MODEM_GSM_ALLOWED_MODE_4G_ONLY = 6,
> -+
> -+ MM_MODEM_GSM_ALLOWED_MODE_LAST = MM_MODEM_GSM_ALLOWED_MODE_4G_ONLY
> -+} MMModemGsmAllowedMode;
> -+
> -+typedef enum {
> -+ MM_MODEM_GSM_ALLOWED_AUTH_UNKNOWN = 0x0000,
> -+ /* bits 0..4 order match Ericsson device bitmap */
> -+ MM_MODEM_GSM_ALLOWED_AUTH_NONE = 0x0001,
> -+ MM_MODEM_GSM_ALLOWED_AUTH_PAP = 0x0002,
> -+ MM_MODEM_GSM_ALLOWED_AUTH_CHAP = 0x0004,
> -+ MM_MODEM_GSM_ALLOWED_AUTH_MSCHAP = 0x0008,
> -+ MM_MODEM_GSM_ALLOWED_AUTH_MSCHAPV2 = 0x0010,
> -+ MM_MODEM_GSM_ALLOWED_AUTH_EAP = 0x0020,
> -+
> -+ MM_MODEM_GSM_ALLOWED_AUTH_LAST = MM_MODEM_GSM_ALLOWED_AUTH_EAP
> -+} MMModemGsmAllowedAuth;
> -+
> +G_DEFINE_TYPE (NMModemOfono, nm_modem_ofono, NM_TYPE_MODEM)
> +
> +#define NM_MODEM_OFONO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_OFONO, NMModemOfonoPrivate))
> @@ -398,13 +357,8 @@
> + DBusGProxy *context_proxy;
> + DBusGProxy *simmanager_proxy;
> +
> -+ DBusGProxyCall *call;
> -+
> + GError *property_error;
> +
> -+ guint connman_iface_source;
> -+ guint connman_iface_retries;
> -+
> + char **interfaces;
> + char *context_path;
> +
> @@ -414,7 +368,7 @@
> +
> + NMIP4Config *ip4_config;
> +
> -+ gboolean state;
> ++ gboolean enabled;
> +} NMModemOfonoPrivate;
> +
> +#define NM_OFONO_ERROR (nm_ofono_error_quark ())
> @@ -422,37 +376,39 @@
> +static GQuark
> +nm_ofono_error_quark (void)
> +{
> -+ static GQuark quark = 0;
> -+ if (!quark)
> -+ quark = g_quark_from_static_string ("nm-ofono-error");
> -+ return quark;
> ++ static GQuark quark = 0;
> ++
> ++ if (!quark)
> ++ quark = g_quark_from_static_string ("nm-ofono-error");
> ++
> ++ return quark;
> +}
> +
> +static gboolean
> +ip_string_to_network_address (const gchar *str,
> + guint32 *out)
> +{
> -+ struct in_addr addr;
> -+
> -+ /* IP address */
> -+ if (inet_pton (AF_INET, str, &addr) <= 0)
> -+ return FALSE;
> -+
> -+ *out = (guint32)addr.s_addr;
> -+ return TRUE;
> ++ struct in_addr addr;
> ++
> ++ /* IP address */
> ++ if (inet_pton (AF_INET, str, &addr) <= 0)
> ++ return FALSE;
> ++
> ++ *out = (guint32)addr.s_addr;
> ++ return TRUE;
> +}
> +
> +/* Disconnect stuff */
> +typedef struct {
> -+ NMModemOfono *self;
> -+ gboolean warn;
> ++ NMModemOfono *self;
> ++ gboolean warn;
> +} SimpleDisconnectContext;
> +
> +static void
> +simple_disconnect_context_free (SimpleDisconnectContext *ctx)
> +{
> -+ g_object_unref (ctx->self);
> -+ g_slice_free (SimpleDisconnectContext, ctx);
> ++ g_object_unref (ctx->self);
> ++ g_slice_free (SimpleDisconnectContext, ctx);
> +}
> +
> +static void
> @@ -460,6 +416,7 @@
> +{
> + SimpleDisconnectContext *ctx = (SimpleDisconnectContext*) user_data;
> + NMModemOfono *self = ctx->self;
> ++ NMModemState state = nm_modem_get_state (NM_MODEM (self));
> + GError *error = NULL;
> +
> + nm_log_dbg (LOGD_MB, "in %s", __func__);
> @@ -472,11 +429,12 @@
> + g_clear_error (&error);
> + }
> +
> -+ simple_disconnect_context_free (ctx);
> ++ simple_disconnect_context_free (ctx);
> +
> -+ nm_modem_set_state (NM_MODEM (self),
> -+ NM_MODEM_STATE_CONNECTED,
> -+ nm_modem_state_to_string (NM_MODEM_STATE_CONNECTED));
> ++ if (state != NM_MODEM_STATE_SEARCHING)
> ++ nm_modem_set_state (NM_MODEM (self),
> ++ NM_MODEM_STATE_REGISTERED,
> ++ nm_modem_state_to_string (NM_MODEM_STATE_REGISTERED));
> +}
> +
> +static void
> @@ -484,14 +442,14 @@
> + gboolean warn)
> +{
> + NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
> -+ SimpleDisconnectContext *ctx;
> ++ SimpleDisconnectContext *ctx;
> + GValue value = G_VALUE_INIT;
> +
> + nm_log_dbg (LOGD_MB, "in %s", __func__);
> +
> -+ ctx = g_slice_new (SimpleDisconnectContext);
> -+ ctx->self = g_object_ref (self);
> -+ ctx->warn = warn;
> ++ ctx = g_slice_new (SimpleDisconnectContext);
> ++ ctx->self = g_object_ref (self);
> ++ ctx->warn = warn;
> +
> + g_value_init (&value, G_TYPE_BOOLEAN);
> + g_value_set_boolean (&value, FALSE);
> @@ -539,7 +497,7 @@
> + NMModemState new_state;
> + NMDeviceStateReason reason;
> +
> -+ if (new_enabled == priv->state)
> ++ if (new_enabled == priv->enabled)
> + return;
> +
> + if (new_enabled) {
> @@ -549,17 +507,13 @@
> + } else {
> + new_state = NM_MODEM_STATE_SEARCHING;
> + reason = NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER;
> -+ //nm_modem_device_state_changed (NM_MODEM (self),
> -+ // NM_DEVICE_STATE_UNAVAILABLE,
> -+ // NM_DEVICE_STATE_UNKNOWN,
> -+ // reason);
> -+ }
> ++ }
> +
> + nm_modem_set_state (NM_MODEM (self),
> + new_state,
> + nm_modem_state_to_string (new_state));
> +
> -+ priv->state = new_enabled;
> ++ priv->enabled = new_enabled;
> +
> + nm_log_info (LOGD_MB, "(%s) now in state: %s",
> + nm_modem_get_path (NM_MODEM (self)),
> @@ -630,10 +584,10 @@
> +
> + if (g_strcmp0 (key, "Powered") == 0 && G_VALUE_HOLDS_BOOLEAN (value)) {
> + priv->gprs_powered = g_value_get_boolean (value);
> -+ }
> -+ else if (g_strcmp0 (key, "Attached") == 0 && G_VALUE_HOLDS_BOOLEAN (value)) {
> ++ } else if (g_strcmp0 (key, "Attached") == 0 && G_VALUE_HOLDS_BOOLEAN (value)) {
> + priv->gprs_attached = g_value_get_boolean (value);
> -+ }
> ++ } else
> ++ return;
> +
> + update_ofono_enabled (self, priv->modem_online
> + && priv->gprs_powered
> @@ -770,8 +724,7 @@
> + nm_modem_get_path (NM_MODEM (self)),
> + OFONO_DBUS_INTERFACE_SIM_MANAGER);
> + }
> -+ }
> -+ else {
> ++ } else {
> + if (priv->simmanager_proxy) {
> + nm_log_info (LOGD_MB, "(%s): SimManager interface disappeared",
> + nm_modem_get_path (NM_MODEM (self)));
> @@ -792,31 +745,30 @@
> + get_ofono_conn_manager_properties (self);
> +
> + dbus_g_proxy_add_signal (priv->connman_proxy, "PropertyChanged",
> -+ G_TYPE_STRING, G_TYPE_VALUE,
> -+ G_TYPE_INVALID);
> ++ G_TYPE_STRING, G_TYPE_VALUE,
> ++ G_TYPE_INVALID);
> + dbus_g_proxy_connect_signal (priv->connman_proxy, "PropertyChanged",
> -+ G_CALLBACK (ofono_conn_properties_changed),
> -+ self,
> -+ NULL);
> ++ G_CALLBACK (ofono_conn_properties_changed),
> ++ self,
> ++ NULL);
> +
> + dbus_g_proxy_add_signal (priv->connman_proxy, "ContextAdded",
> -+ DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT,
> -+ G_TYPE_INVALID);
> ++ DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT,
> ++ G_TYPE_INVALID);
> + dbus_g_proxy_connect_signal (priv->connman_proxy, "ContextAdded",
> -+ G_CALLBACK (ofono_context_added),
> -+ self,
> -+ NULL);
> ++ G_CALLBACK (ofono_context_added),
> ++ self,
> ++ NULL);
> + dbus_g_proxy_add_signal (priv->connman_proxy, "ContextRemoved",
> -+ DBUS_TYPE_G_OBJECT_PATH,
> -+ G_TYPE_INVALID);
> ++ DBUS_TYPE_G_OBJECT_PATH,
> ++ G_TYPE_INVALID);
> + dbus_g_proxy_connect_signal (priv->connman_proxy, "ContextRemoved",
> -+ G_CALLBACK (ofono_context_removed),
> -+ self,
> -+ NULL);
> ++ G_CALLBACK (ofono_context_removed),
> ++ self,
> ++ NULL);
> + }
> + }
> -+ }
> -+ else {
> ++ } else {
> + if (priv->connman_proxy) {
> + nm_log_info (LOGD_MB, "(%s): ConnectionManager interface disappeared",
> + nm_modem_get_path (NM_MODEM (self)));
> @@ -860,8 +812,6 @@
> +
> + nm_log_dbg (LOGD_MB, "in %s", __func__);
> +
> -+ priv->call = NULL;
> -+
> + if (priv->connect_properties) {
> + g_hash_table_destroy (priv->connect_properties);
> + priv->connect_properties = NULL;
> @@ -875,6 +825,13 @@
> + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE,
> + NM_DEVICE_STATE_REASON_MODEM_BUSY);
> +
> ++ /*
> ++ * FIXME: add code to check for InProgress so that the
> ++ * connection doesn't continue to try and activate,
> ++ * leading to the connection being disabled, and a 5m
> ++ * timeout...
> ++ */
> ++
> + g_error_free (error);
> + }
> +}
> @@ -964,7 +921,7 @@
> + dns = (char **) g_value_get_boxed (g_hash_table_lookup (ip_settings, "DomainNameServers"));
> + for (i = 0; dns[i]; i++) {
> + if ( ip_string_to_network_address (dns[i], &address_network)
> -+ && address_network > 0) {
> ++ && address_network > 0) {
> + nm_ip4_config_add_nameserver (priv->ip4_config, address_network);
> + nm_log_info (LOGD_MB, " DNS %s", dns[i]);
> + }
> @@ -1080,7 +1037,7 @@
> +
> + dbus_g_proxy_begin_call_with_timeout (priv->context_proxy,
> + "SetProperty", stage1_prepare_done,
> -+ self, NULL, 20000,
> ++ self, NULL, 40000,
Yes, while testing, I had at least one failure due to the timeout being too short. The bzr commit message includes the reasoning ( ie. to align with connman ). If it'll make you happy, I'll split into it's own commit.
> + G_TYPE_STRING, "Active",
> + G_TYPE_VALUE, &value,
> + G_TYPE_INVALID);
> @@ -1113,8 +1070,8 @@
> + } else {
> + nm_log_warn (LOGD_MB, "could not set context property '%s': %s", (char*)key,
> + priv->property_error
> -+ && priv->property_error->message
> -+ ? priv->property_error->message : "(unknown)");
> ++ && priv->property_error->message
> ++ ? priv->property_error->message : "(unknown)");
> + }
> +}
> +
> @@ -1144,127 +1101,6 @@
> + }
> +}
> +
> -+static void
> -+create_new_context_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
> -+{
> -+ NMModemOfono *self = NM_MODEM_OFONO (user_data);
> -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
> -+ GError *error = NULL;
> -+ char *context_path = NULL;
> -+ gboolean ret = FALSE;
> -+
> -+ nm_log_dbg (LOGD_MB, "in %s", __func__);
> -+
> -+ ret = dbus_g_proxy_end_call (proxy,
> -+ call_id,
> -+ &error,
> -+ DBUS_TYPE_G_OBJECT_PATH, &context_path,
> -+ G_TYPE_INVALID);
> -+
> -+ nm_log_dbg (LOGD_MB, "%s: context path: %s", __func__, context_path);
> -+
> -+ if (ret)
> -+ do_context_prepare (self, context_path);
> -+ else {
> -+ nm_log_warn (LOGD_MB, "Ofono modem context creation failed: (%d) %s",
> -+ error ? error->code : -1,
> -+ error && error->message ? error->message : "(unknown)");
> -+
> -+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED);
> -+
> -+ g_error_free (error);
> -+ }
> -+}
> -+
> -+static void
> -+do_create_new_context (NMModemOfono *self)
> -+{
> -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
> -+ DBusGProxy *proxy;
> -+
> -+ g_return_val_if_fail (self != NULL, FALSE);
> -+ g_return_val_if_fail (NM_IS_MODEM_OFONO (self), FALSE);
> -+
> -+ nm_log_dbg (LOGD_MB, "in %s", __func__);
> -+
> -+ if (priv->connman_proxy) {
> -+ dbus_g_proxy_begin_call_with_timeout (priv->connman_proxy,
> -+ "AddContext", create_new_context_done,
> -+ self, NULL, 20000,
> -+ G_TYPE_STRING, "internet",
> -+ G_TYPE_INVALID);
> -+ }
> -+ else {
> -+ nm_log_err (LOGD_MB, "could not bring up connection manager proxy "
> -+ "to add a new context");
> -+ }
> -+}
> -+
> -+static gboolean
> -+try_create_new_context (NMModemOfono *self)
> -+{
> -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
> -+ GHashTable *properties;
> -+ char **interfaces;
> -+ GError *error = NULL;
> -+ gboolean found = FALSE;
> -+ int i;
> -+
> -+ nm_log_dbg (LOGD_MB, "in %s", __func__);
> -+
> -+ /* Only retry up to 20 times */
> -+ if (priv->connman_iface_retries < 20) {
> -+ dbus_g_proxy_call_with_timeout (priv->modem_proxy,
> -+ "GetProperties",
> -+ 250, &error,
> -+ G_TYPE_INVALID,
> -+ DBUS_TYPE_G_MAP_OF_VARIANT, &properties,
> -+ G_TYPE_INVALID);
> -+
> -+ if (!error) {
> -+ interfaces = (char **) g_value_get_boxed (g_hash_table_lookup (properties, "Interfaces"));
> -+
> -+ for (i = 0; interfaces[i]; i++) {
> -+ nm_log_dbg (LOGD_MB, "%s ?? %s",
> -+ interfaces[i],
> -+ OFONO_DBUS_INTERFACE_CONNECTION_MANAGER);
> -+ if (!g_strcmp0 (interfaces[i],
> -+ OFONO_DBUS_INTERFACE_CONNECTION_MANAGER)) {
> -+ found = TRUE;
> -+ break;
> -+ }
> -+ }
> -+ }
> -+ else {
> -+ nm_log_dbg (LOGD_MB, "failed test for properties: %s",
> -+ error && error->message ? error->message : "(unknown)");
> -+ }
> -+ priv->connman_iface_retries++;
> -+ }
> -+ else {
> -+ if (priv->connman_iface_source != 0)
> -+ g_source_remove (priv->connman_iface_source);
> -+
> -+ priv->connman_iface_source = 0;
> -+ priv->connman_iface_retries = 0;
> -+
> -+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, 0);
> -+
> -+ return FALSE;
> -+ }
> -+
> -+ if (found) {
> -+ if (priv->connman_iface_source != 0)
> -+ g_source_remove (priv->connman_iface_source);
> -+
> -+ priv->connman_iface_source = 0;
> -+ priv->connman_iface_retries = 0;
> -+ do_create_new_context (self);
> -+ }
> -+
> -+ return !found;
> -+}
> -+
> +static void stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data);
> +
> +static void
> @@ -1277,12 +1113,6 @@
> + nm_log_dbg (LOGD_MB, "in %s", __func__);
> +
> + if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) {
> -+#if 0
> -+ /* Try once every 5 seconds to see if we've got the right interfaces */
> -+ priv->connman_iface_retries = 0;
> -+ priv->connman_iface_source
> -+ = g_timeout_add (500, (GSourceFunc) try_create_new_context, self);
> -+#endif
> + if (priv->context_path)
> + do_context_activate (self, priv->context_path);
> + else
> @@ -1503,44 +1333,6 @@
> + G_TYPE_INVALID);
> +}
> +
> -+#if 0
> -+static void
> -+set_ofono_enabled (NMModem *self, gboolean enabled)
> -+{
> -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
> -+ GValue value = G_VALUE_INIT;
> -+ gboolean ret;
> -+ GError *error = NULL;
> -+
> -+ g_return_if_fail (self != NULL);
> -+ g_return_if_fail (NM_IS_MODEM_OFONO (self));
> -+ g_return_if_fail (priv != NULL);
> -+ g_return_if_fail (priv->connman_proxy != NULL);
> -+
> -+ nm_log_dbg (LOGD_MB, "in %s", __func__);
> -+
> -+ g_value_init (&value, G_TYPE_BOOLEAN);
> -+ g_value_set_boolean (&value, enabled);
> -+
> -+ ret = dbus_g_proxy_call_with_timeout (priv->connman_proxy,
> -+ "SetProperty",
> -+ 20000,
> -+ &error,
> -+ G_TYPE_STRING, "Powered",
> -+ G_TYPE_VALUE, &value,
> -+ G_TYPE_INVALID,
> -+ G_TYPE_INVALID);
> -+
> -+ if (!ret) {
> -+ nm_log_warn (LOGD_MB, "OFONO modem set enabled failed: (%d) %s",
> -+ error ? error->code : -1,
> -+ error && error->message ? error->message : "(unknown)");
> -+ }
> -+ else {
> -+ get_ofono_conn_manager_properties (self);
> -+ }
> -+}
> -+#endif
> +static void
> +set_ofono_enabled (NMModem *self, gboolean enabled)
> +{
> @@ -1548,7 +1340,11 @@
> +
> + nm_log_info (LOGD_MB, "(%s): trying to set modem to %s",
> + nm_modem_get_path (self),
> -+ enabled ? "enabled" : "disabled");
> ++ enabled ? "enabled" : "disabled");
> ++
> ++ /* FIXME: this is code is a no-op; we should either make
> ++ * work, or get rid of this function, or at least remove
> ++ * the call to update_ofono_enabled. */
> +
> + update_ofono_enabled (NM_MODEM_OFONO (self),
> + priv->modem_online
> @@ -1562,8 +1358,7 @@
> + NMDeviceModemCapabilities *current_caps)
> +{
> + NMModemOfono *self = NM_MODEM_OFONO (_self);
> -+ NMDeviceModemCapabilities all_ofono_caps
> -+ = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS;
> ++ NMDeviceModemCapabilities all_ofono_caps = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS;
> +
> + *modem_caps = all_ofono_caps;
> + *current_caps = all_ofono_caps;
> @@ -1583,9 +1378,6 @@
> + priv->context_proxy = NULL;
> + priv->simmanager_proxy = NULL;
> +
> -+ priv->connman_iface_source = 0;
> -+ priv->connman_iface_retries = 0;
> -+
> + priv->modem_online = FALSE;
> + priv->gprs_powered = FALSE;
> + priv->gprs_attached = FALSE;
> @@ -1595,8 +1387,8 @@
> +
> +static GObject*
> +constructor (GType type,
> -+ guint n_construct_params,
> -+ GObjectConstructParam *construct_params)
> ++ guint n_construct_params,
> ++ GObjectConstructParam *construct_params)
> +{
> + GObject *object;
> + NMModemOfonoPrivate *priv;
> @@ -1669,24 +1461,19 @@
> + object_class->constructor = constructor;
> + object_class->dispose = dispose;
> +
> -+ modem_class->get_capabilities = get_capabilities;
> ++ modem_class->get_capabilities = get_capabilities;
> + modem_class->set_mm_enabled = set_ofono_enabled;
> -+ modem_class->disconnect = disconnect;
> ++ modem_class->disconnect = disconnect;
> + modem_class->deactivate = deactivate;
> -+ //modem_class->get_user_pass = get_user_pass;
> -+ //modem_class->get_setting_name = get_setting_name;
> -+ //modem_class->complete_connection = complete_connection;
> + modem_class->check_connection_compatible = check_connection_compatible;
> + modem_class->act_stage1_prepare = act_stage1_prepare;
> -+ modem_class->static_stage3_ip4_config_start = static_stage3_ip4_config_start;
> -+
> -+ //dbus_g_error_domain_register (NM_OFONO_ERROR, NULL, NM_TYPE_OFONO_ERROR);
> ++ modem_class->static_stage3_ip4_config_start = static_stage3_ip4_config_start;
> +}
> +
> -Index: b/src/devices/wwan/nm-modem-ofono.h
> +Index: network-manager-0.9.10.0/src/devices/wwan/nm-modem-ofono.h
> ===================================================================
> --- /dev/null
> -+++ b/src/devices/wwan/nm-modem-ofono.h
> ++++ network-manager-0.9.10.0/src/devices/wwan/nm-modem-ofono.h
> @@ -0,0 +1,64 @@
> +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
> +/* NetworkManager -- Network link manager
> @@ -1752,10 +1539,10 @@
> +G_END_DECLS
> +
> +#endif /* NM_MODEM_OFONO_H */
> -Index: b/src/NetworkManagerUtils.c
> +Index: network-manager-0.9.10.0/src/NetworkManagerUtils.c
> ===================================================================
> ---- a/src/NetworkManagerUtils.c
> -+++ b/src/NetworkManagerUtils.c
> +--- network-manager-0.9.10.0.orig/src/NetworkManagerUtils.c
> ++++ network-manager-0.9.10.0/src/NetworkManagerUtils.c
> @@ -1221,7 +1221,13 @@ nm_utils_ip6_property_path (const char *
>
> len = g_snprintf (path, sizeof (path), IPV6_PROPERTY_DIR "%s/%s",
> @@ -1787,3 +1574,39 @@
> + return name;
> }
>
> +Index: network-manager-0.9.10.0/src/devices/wwan/nm-device-modem.c
> +===================================================================
> +--- network-manager-0.9.10.0.orig/src/devices/wwan/nm-device-modem.c
> ++++ network-manager-0.9.10.0/src/devices/wwan/nm-device-modem.c
> +@@ -201,6 +201,16 @@ modem_state_cb (NMModem *modem,
No, this is one part of the fix and is based on my discussion with dcbw. The other part of the fix lives in nm-modem-ofono.c.
> + }
> + }
> +
> ++ if (dev_state >= NM_DEVICE_STATE_DISCONNECTED &&
> ++ new_state == NM_MODEM_STATE_REGISTERED && old_state < NM_MODEM_STATE_REGISTERED) {
> ++
> ++ nm_log_info (LOGD_MB, "(%s): modem re-registered; re-checking autoconnect",
> ++ nm_device_get_iface (device));
> ++
> ++ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, TRUE, NULL);
> ++ nm_device_emit_recheck_auto_activate (device);
> ++ }
> ++
> + if (new_state < NM_MODEM_STATE_CONNECTING &&
> + old_state >= NM_MODEM_STATE_CONNECTING &&
> + dev_state >= NM_DEVICE_STATE_NEED_AUTH &&
> +@@ -271,6 +281,14 @@ device_state_changed (NMDevice *device,
> + nm_modem_state_to_string (nm_modem_get_state (priv->modem)));
> + }
> +
> ++ /* Block autoconnect until the modem is registered again */
> ++ if (new_state == NM_DEVICE_STATE_FAILED && nm_modem_get_state (priv->modem) == NM_MODEM_STATE_SEARCHING) {
> ++ nm_log_info (LOGD_MB, "(%s): modem searching; disabling autoconnect",
> ++ nm_device_get_iface (device));
> ++
> ++ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL);
> ++ }
> ++
> + nm_modem_device_state_changed (priv->modem, new_state, old_state, reason);
> +
> + switch (reason) {
>
--
https://code.launchpad.net/~phablet-team/network-manager/lp1418077/+merge/255285
Your team Ubuntu Phablet Team is requested to review the proposed merge of lp:~phablet-team/network-manager/lp1418077 into lp:~network-manager/network-manager/ubuntu.
More information about the Ubuntu-reviews
mailing list