aboutsummaryrefslogtreecommitdiff
path: root/src/mm-bearer-mbim.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2023-02-17 14:18:16 +0000
committerAleksander Morgado <aleksandermj@chromium.org>2023-02-20 11:07:38 +0000
commit6d1f4aee305a6ebeae7bec8b745de33d5368371d (patch)
treeb608fed991d2b5feae23d83e2f7e94dc1288029d /src/mm-bearer-mbim.c
parent278678d8ed818a778377dcb57f5611b04c631450 (diff)
broadband-modem-mbim: limit the use of context types defined in MBIMEx
The Tethering context type UUID was defined by Microsoft in its extensions as `5e4e0601-48dc-4e2b-acb8-08b4016bbaac` (along with others like Admin, Xcap, App and EmergencyCalling), see https://learn.microsoft.com/en-us/windows-hardware/drivers/network/mb-provisioned-context-operations. These UUIDs are expected to be usable only if the modem supports `MBIM_CID_MS_PROVISIONED_CONTEXT_V2` (CID=1) in the Basic Connect Extensions service (3d01dcc5-fef5-4d05-0d3abef7058e9aaf). If the modem doesn't support these, we should try to fallback to a more generic APN type automatically, e.g. "Internet", which was defined in MBIM 1.0 and should always be supported. There should be no problem in a modem to have 2 separate PDN connections with the same context type.
Diffstat (limited to 'src/mm-bearer-mbim.c')
-rw-r--r--src/mm-bearer-mbim.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
index 28aa9638..713b7aaf 100644
--- a/src/mm-bearer-mbim.c
+++ b/src/mm-bearer-mbim.c
@@ -907,9 +907,13 @@ load_settings_from_profile (MMBearerMbim *self,
MMBearerApnType default_apn_type,
GError **error)
{
- MMBearerAllowedAuth bearer_auth;
- MMBearerApnType apn_type;
- GError *inner_error = NULL;
+ MMBearerAllowedAuth bearer_auth;
+ MMBearerApnType apn_type;
+ GError *inner_error = NULL;
+ g_autoptr(MMBaseModem) modem = NULL;
+
+ g_object_get (self, MM_BASE_BEARER_MODEM, &modem, NULL);
+ g_assert (modem);
/* APN settings */
ctx->apn = g_strdup (mm_3gpp_profile_get_apn (profile));
@@ -922,7 +926,11 @@ load_settings_from_profile (MMBearerMbim *self,
}
apn_type = default_apn_type;
}
- ctx->context_type = mm_bearer_apn_type_to_mbim_context_type (apn_type, self, &inner_error);
+ ctx->context_type = mm_bearer_apn_type_to_mbim_context_type (
+ apn_type,
+ mm_broadband_modem_mbim_is_context_type_ext_supported (MM_BROADBAND_MODEM_MBIM (modem)),
+ self,
+ &inner_error);
if (inner_error) {
g_propagate_error (error, inner_error);
return FALSE;