aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-3gpp.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-11-20 10:17:38 +0100
committerDan Williams <dcbw@redhat.com>2018-12-07 16:20:53 +0000
commit1e09b586a72bf4d7ff8ea6badc65289f57ade760 (patch)
tree8db5d49d535c7b14442937603969e89f2434361b /src/mm-iface-modem-3gpp.c
parent48ba504f4e7e59cde380954fba84a790d34eaef4 (diff)
broadband-modem-mbim: implement initial EPS bearer status support
We use the "LTE attach status" extension defined by Microsoft to query and monitor the initial EPS bearer settings. https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-lte-attach-operations
Diffstat (limited to 'src/mm-iface-modem-3gpp.c')
-rw-r--r--src/mm-iface-modem-3gpp.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index e5b40a14..35771407 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -1650,32 +1650,30 @@ mm_iface_modem_3gpp_update_initial_eps_bearer (MMIfaceModem3gpp *self,
MMBearerProperties *properties)
{
MmGdbusModem3gpp *skeleton = NULL;
- MMBaseBearer *attach = NULL;
- gboolean skip_update = FALSE;
+ MMBaseBearer *old_bearer = NULL;
g_object_get (self,
MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton,
- MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, &attach,
+ MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, &old_bearer,
NULL);
g_assert (skeleton);
- if (attach) {
- skip_update = (properties && mm_bearer_properties_cmp (properties, mm_base_bearer_peek_config (MM_BASE_BEARER (attach))));
- g_object_unref (attach);
- }
+ /* skip update? */
+ if ((!old_bearer && !properties) ||
+ (old_bearer && properties && mm_bearer_properties_cmp (properties, mm_base_bearer_peek_config (MM_BASE_BEARER (old_bearer)))))
+ goto out;
- if (skip_update) {
- mm_dbg ("skipping initial EPS bearer update: configuration didn't change");
- } else if (properties) {
- mm_dbg ("updating initial EPS bearer...");
+ if (properties) {
+ MMBaseBearer *new_bearer;
+ mm_dbg ("updating initial EPS bearer...");
g_assert (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_initial_eps_bearer);
- attach = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_initial_eps_bearer (self, properties);
+ new_bearer = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_initial_eps_bearer (self, properties);
g_object_set (self,
- MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, attach,
+ MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, new_bearer,
NULL);
- mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, mm_base_bearer_get_path (attach));
- g_object_unref (attach);
+ mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, mm_base_bearer_get_path (new_bearer));
+ g_object_unref (new_bearer);
} else {
mm_dbg ("clearing initial EPS bearer...");
g_object_set (self,
@@ -1684,6 +1682,8 @@ mm_iface_modem_3gpp_update_initial_eps_bearer (MMIfaceModem3gpp *self,
mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, NULL);
}
+out:
+ g_clear_object (&old_bearer);
g_object_unref (skeleton);
}