diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-07-13 15:47:38 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-07-13 15:47:38 +0200 |
commit | daf72fe169f40bcb637a0a4db1a763bd54909d20 (patch) | |
tree | 6bf3b4dbf266dd0dfceac27a68fc80eaf155ea0d /src | |
parent | c4b5879e45cce3eed6136131cefcdfd3f9590916 (diff) |
base-bearer: setup common default for unknown multiplex fallback
If the user doesn't provide a specific multiplex setting, we'll
fallback to a predefined default.
For now, the default is REQUESTED.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-base-bearer.h | 5 | ||||
-rw-r--r-- | src/mm-bearer-mbim.c | 8 | ||||
-rw-r--r-- | src/mm-bearer-qmi.c | 4 | ||||
-rw-r--r-- | src/mm-broadband-bearer.c | 6 |
4 files changed, 17 insertions, 6 deletions
diff --git a/src/mm-base-bearer.h b/src/mm-base-bearer.h index 993abaa4..151b8c30 100644 --- a/src/mm-base-bearer.h +++ b/src/mm-base-bearer.h @@ -67,6 +67,11 @@ gint mm_bearer_connect_result_get_profile_id (MMBearerConnec /*****************************************************************************/ +/* Default multiplex support setting to use when none explicitly given */ +#define MM_BASE_BEARER_MULTIPLEX_SUPPORT_DEFAULT MM_BEARER_MULTIPLEX_SUPPORT_REQUESTED + +/*****************************************************************************/ + #define MM_TYPE_BASE_BEARER (mm_base_bearer_get_type ()) #define MM_BASE_BEARER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_BEARER, MMBaseBearer)) #define MM_BASE_BEARER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BASE_BEARER, MMBaseBearerClass)) diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index 1d894b33..101c75cd 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -1172,11 +1172,13 @@ load_settings_from_bearer (MMBearerMbim *self, if (!g_strcmp0 (data_port_driver, "mhi_net")) multiplex_supported = FALSE; - /* If no multiplex setting given by the user, assume requested */ + /* If no multiplex setting given by the user, assume default */ multiplex = mm_bearer_properties_get_multiplex (properties); + if (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN) + multiplex = MM_BASE_BEARER_MULTIPLEX_SUPPORT_DEFAULT; + if (multiplex_supported && - (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN || - multiplex == MM_BEARER_MULTIPLEX_SUPPORT_REQUESTED || + (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_REQUESTED || multiplex == MM_BEARER_MULTIPLEX_SUPPORT_REQUIRED)) { /* the link prefix hint given must be modem-specific */ ctx->link_prefix_hint = g_strdup_printf ("mbimmux%u.", mm_base_modem_get_dbus_id (MM_BASE_MODEM (ctx->modem))); diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c index 86959765..0bb5b81c 100644 --- a/src/mm-bearer-qmi.c +++ b/src/mm-bearer-qmi.c @@ -2141,10 +2141,10 @@ load_settings_from_bearer (MMBearerQmi *self, GError *inner_error = NULL; const gchar *str; - /* If no multiplex setting given by the user, assume requested */ + /* If no multiplex setting given by the user, assume default */ ctx->multiplex = mm_bearer_properties_get_multiplex (properties); if (ctx->multiplex == MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN) - ctx->multiplex = MM_BEARER_MULTIPLEX_SUPPORT_REQUESTED; + ctx->multiplex = MM_BASE_BEARER_MULTIPLEX_SUPPORT_DEFAULT; /* The link prefix hint given must be modem-specific */ if (ctx->multiplex == MM_BEARER_MULTIPLEX_SUPPORT_REQUESTED || diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index 0b2d85bb..bfe16183 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -1011,8 +1011,12 @@ connect (MMBaseBearer *self, return; } - /* The generic broadband bearer doesn't support multiplexing */ + /* If no multiplex setting given by the user, assume default */ multiplex = mm_bearer_properties_get_multiplex (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + if (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN) + multiplex = MM_BASE_BEARER_MULTIPLEX_SUPPORT_DEFAULT; + + /* The generic broadband bearer doesn't support multiplexing */ if (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_REQUIRED) { g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "Multiplexing required but not supported"); |