diff options
Diffstat (limited to 'src/modem-manager')
| -rw-r--r-- | src/modem-manager/Makefile.in | 8 | ||||
| -rw-r--r-- | src/modem-manager/nm-modem-manager.c | 29 | ||||
| -rw-r--r-- | src/modem-manager/nm-modem.c | 14 |
3 files changed, 41 insertions, 10 deletions
diff --git a/src/modem-manager/Makefile.in b/src/modem-manager/Makefile.in index 2a054f70..c78ed0f3 100644 --- a/src/modem-manager/Makefile.in +++ b/src/modem-manager/Makefile.in @@ -189,8 +189,16 @@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ +LIBNL1_CFLAGS = @LIBNL1_CFLAGS@ +LIBNL1_LIBS = @LIBNL1_LIBS@ +LIBNL2_CFLAGS = @LIBNL2_CFLAGS@ +LIBNL2_LIBS = @LIBNL2_LIBS@ +LIBNL3_CFLAGS = @LIBNL3_CFLAGS@ +LIBNL3_LIBS = @LIBNL3_LIBS@ LIBNL_CFLAGS = @LIBNL_CFLAGS@ LIBNL_LIBS = @LIBNL_LIBS@ +LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@ +LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c index f5ade50c..3509d667 100644 --- a/src/modem-manager/nm-modem-manager.c +++ b/src/modem-manager/nm-modem-manager.c @@ -29,6 +29,7 @@ #include "nm-dbus-manager.h" #include "nm-modem-types.h" #include "nm-marshal.h" +#include "nm-dbus-glib-types.h" #define MODEM_POKE_INTERVAL 120 @@ -235,6 +236,23 @@ modem_removed (DBusGProxy *proxy, const char *path, gpointer user_data) } } +static void +mm_poke_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) +{ + GPtrArray *modems; + int i; + + if (dbus_g_proxy_end_call (proxy, call, NULL, + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &modems, + G_TYPE_INVALID)) { + /* Don't care about the returned value, just free it */ + for (i = 0; i < modems->len; i++) + g_free ((char *) g_ptr_array_index (modems, i)); + g_ptr_array_free (modems, TRUE); + } + g_object_unref (proxy); +} + static gboolean poke_modem_cb (gpointer user_data) { @@ -242,6 +260,7 @@ poke_modem_cb (gpointer user_data) NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (self); DBusGConnection *g_connection; DBusGProxy *proxy; + DBusGProxyCall *call; g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); proxy = dbus_g_proxy_new_for_name (g_connection, @@ -249,9 +268,13 @@ poke_modem_cb (gpointer user_data) MM_DBUS_PATH, MM_DBUS_INTERFACE); - dbus_g_proxy_call_no_reply (proxy, "EnumerateDevices", G_TYPE_INVALID); - g_object_unref (proxy); - + call = dbus_g_proxy_begin_call_with_timeout (proxy, + "EnumerateDevices", + mm_poke_cb, + NULL, + NULL, + 5000, + G_TYPE_INVALID); return TRUE; } diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 1823e5e6..debfbdf7 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -640,7 +640,7 @@ static void real_deactivate (NMModem *self, NMDevice *device) { NMModemPrivate *priv; - const char *iface; + int ifindex; g_return_if_fail (self != NULL); g_return_if_fail (NM_IS_MODEM (self)); @@ -679,11 +679,11 @@ real_deactivate (NMModem *self, NMDevice *device) break; case MM_MODEM_IP_METHOD_STATIC: case MM_MODEM_IP_METHOD_DHCP: - iface = nm_device_get_ip_iface (device); + ifindex = nm_device_get_ip_ifindex (device); /* FIXME: use AF_UNSPEC here when we have IPv6 support */ - nm_system_device_flush_routes_with_iface (iface, AF_INET); - nm_system_device_flush_addresses_with_iface (iface); - nm_system_device_set_up_down_with_iface (iface, FALSE, NULL); + nm_system_iface_flush_routes (ifindex, AF_INET); + nm_system_iface_flush_addresses (ifindex, AF_UNSPEC); + nm_system_iface_set_up (ifindex, FALSE, NULL); break; default: nm_log_err (LOGD_MB, "unknown IP method %d", priv->ip_method); @@ -775,7 +775,7 @@ nm_modem_hw_is_up (NMModem *self, NMDevice *device) state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); if (priv->pending_ip4_config || _state_is_active (state)) - return nm_system_device_is_up (device); + return nm_system_iface_is_up (nm_device_get_ip_ifindex (device)); } return TRUE; @@ -792,7 +792,7 @@ nm_modem_hw_bring_up (NMModem *self, NMDevice *device, gboolean *no_firmware) state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); if (priv->pending_ip4_config || _state_is_active (state)) - return nm_system_device_set_up_down (device, TRUE, no_firmware); + return nm_system_iface_set_up (nm_device_get_ip_ifindex (device), TRUE, no_firmware); } return TRUE; |