diff --git a/configure.ac b/configure.ac index 84c76e02a5..4f1649fa38 100644 --- a/configure.ac +++ b/configure.ac @@ -463,7 +463,7 @@ AC_SUBST(PPPD_PLUGIN_DIR) AC_ARG_WITH(modem-manager-1, AS_HELP_STRING([--with-modem-manager-1], [Enable new ModemManager1 interface support]),,[with_modem_manager_1=auto]) if (test "${with_modem_manager_1}" != "no"); then PKG_CHECK_MODULES(MM_GLIB, - [mm-glib], + [mm-glib >= 0.7.991], [have_libmm_glib=yes], [have_libmm_glib=no]) AC_SUBST(MM_GLIB_CFLAGS) @@ -775,4 +775,3 @@ echo " tests: $enable_tests" echo " valgrind: $with_valgrind" echo " code coverage: $enable_code_coverage" echo - diff --git a/src/modem-manager/nm-modem-broadband.c b/src/modem-manager/nm-modem-broadband.c index d6fbac9f90..5e13d7010f 100644 --- a/src/modem-manager/nm-modem-broadband.c +++ b/src/modem-manager/nm-modem-broadband.c @@ -106,9 +106,23 @@ get_capabilities (NMModem *_self, NMDeviceModemCapabilities *current_caps) { NMModemBroadband *self = NM_MODEM_BROADBAND (_self); + MMModemCapability all_supported = MM_MODEM_CAPABILITY_NONE; + MMModemCapability *supported; + guint n_supported; - *modem_caps = (NMDeviceModemCapabilities)mm_modem_get_modem_capabilities (self->priv->modem_iface); - *current_caps = (NMDeviceModemCapabilities)mm_modem_get_current_capabilities (self->priv->modem_iface); + /* For now, we don't care about the capability combinations, just merge all + * combinations in a single mask */ + if (mm_modem_get_supported_capabilities (self->priv->modem_iface, &supported, &n_supported)) { + guint i; + + for (i = 0; i < n_supported; i++) + all_supported |= supported[i]; + + g_free (supported); + } + + *modem_caps = (NMDeviceModemCapabilities) all_supported; + *current_caps = (NMDeviceModemCapabilities) mm_modem_get_current_capabilities (self->priv->modem_iface); } /*****************************************************************************/