diff options
-rw-r--r-- | introspection/org.freedesktop.ModemManager1.Modem.xml | 8 | ||||
-rw-r--r-- | src/mm-iface-modem.c | 41 | ||||
-rw-r--r-- | src/mm-iface-modem.h | 8 |
3 files changed, 57 insertions, 0 deletions
diff --git a/introspection/org.freedesktop.ModemManager1.Modem.xml b/introspection/org.freedesktop.ModemManager1.Modem.xml index 42f80419..48b51514 100644 --- a/introspection/org.freedesktop.ModemManager1.Modem.xml +++ b/introspection/org.freedesktop.ModemManager1.Modem.xml @@ -470,5 +470,13 @@ --> <property name="Bands" type="au" access="read" /> + <!-- + SupportedIpFamilies: + + Bitmask of <link linkend="MMBearerIpFamily">MMBearerIpFamily</link> values, + specifying the IP families supported by the device. + --> + <property name="SupportedIpFamilies" type="u" access="read" /> + </interface> </node> diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 8eadc73b..54340880 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -3444,6 +3444,7 @@ typedef enum { INITIALIZATION_STEP_DEVICE_ID, INITIALIZATION_STEP_SUPPORTED_MODES, INITIALIZATION_STEP_SUPPORTED_BANDS, + INITIALIZATION_STEP_SUPPORTED_IP_FAMILIES, INITIALIZATION_STEP_POWER_STATE, INITIALIZATION_STEP_UNLOCK_REQUIRED, INITIALIZATION_STEP_SIM, @@ -3696,6 +3697,29 @@ load_supported_bands_ready (MMIfaceModem *self, interface_initialization_step (ctx); } +static void +load_supported_ip_families_ready (MMIfaceModem *self, + GAsyncResult *res, + InitializationContext *ctx) +{ + GError *error = NULL; + MMBearerIpFamily ip_families; + + ip_families = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_ip_families_finish (self, res, &error); + + if (ip_families != MM_BEARER_IP_FAMILY_NONE) + mm_gdbus_modem_set_supported_ip_families (ctx->skeleton, ip_families); + + if (error) { + mm_warn ("couldn't load Supported IP families: '%s'", error->message); + g_error_free (error); + } + + /* Go on to next step */ + ctx->step++; + interface_initialization_step (ctx); +} + UINT_REPLY_READY_FN (power_state, "Power State") static void @@ -4033,6 +4057,22 @@ interface_initialization_step (InitializationContext *ctx) ctx->step++; } + case INITIALIZATION_STEP_SUPPORTED_IP_FAMILIES: + /* Supported ip_families are meant to be loaded only once during the whole + * lifetime of the modem. Therefore, if we already have them loaded, + * don't try to load them again. */ + if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families != NULL && + MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families_finish != NULL && + mm_gdbus_modem_get_supported_ip_families (ctx->skeleton) == MM_BEARER_IP_FAMILY_NONE) { + MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families ( + ctx->self, + (GAsyncReadyCallback)load_supported_ip_families_ready, + ctx); + return; + } + /* Fall down to next step */ + ctx->step++; + case INITIALIZATION_STEP_POWER_STATE: /* Initial power state is meant to be loaded only once. Therefore, if we * already have it loaded, don't try to load it again. */ @@ -4222,6 +4262,7 @@ mm_iface_modem_initialize (MMIfaceModem *self, mm_gdbus_modem_set_preferred_mode (skeleton, MM_MODEM_MODE_NONE); mm_gdbus_modem_set_supported_bands (skeleton, mm_common_build_bands_unknown ()); mm_gdbus_modem_set_bands (skeleton, mm_common_build_bands_unknown ()); + mm_gdbus_modem_set_supported_ip_families (skeleton, MM_BEARER_IP_FAMILY_NONE); mm_gdbus_modem_set_power_state (skeleton, MM_MODEM_POWER_STATE_UNKNOWN); mm_gdbus_modem_set_state_failed_reason (skeleton, MM_MODEM_STATE_FAILED_REASON_NONE); diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h index ba9282fe..5a41aa2a 100644 --- a/src/mm-iface-modem.h +++ b/src/mm-iface-modem.h @@ -156,6 +156,14 @@ struct _MMIfaceModem { GAsyncResult *res, GError **error); + /* Loading of the SupportedIpFamilies property */ + void (* load_supported_ip_families) (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + MMBearerIpFamily (* load_supported_ip_families_finish) (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + /* Loading of the PowerState property */ void (* load_power_state) (MMIfaceModem *self, GAsyncReadyCallback callback, |