diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-07-29 00:07:27 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-08-09 12:22:26 +0000 |
commit | 185e492c0a0e633ed92f8ffdb1c426d0e4300ae1 (patch) | |
tree | 603e8f11ccd7e33a3ceca1a5fa82cc4cbabac0a2 | |
parent | c49f3f5f46e6f1a27108e9826c32af776ec111f9 (diff) |
core: new '--test-multiplex-requested' option
The new option will change the default setting in MBIM and QMI bearers
to "request" when no explicit "multiplex" configuration is given by
the user.
This option will help test the multiplexing support in the modems
before it's made a default in a future release.
-rw-r--r-- | src/mm-bearer-mbim.c | 9 | ||||
-rw-r--r-- | src/mm-bearer-qmi.c | 5 | ||||
-rw-r--r-- | src/mm-context.c | 13 | ||||
-rw-r--r-- | src/mm-context.h | 3 |
4 files changed, 26 insertions, 4 deletions
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index fa8630bc..d5099292 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -32,6 +32,7 @@ #include "mm-port-enums-types.h" #include "mm-bearer-mbim.h" #include "mm-log-object.h" +#include "mm-context.h" G_DEFINE_TYPE (MMBearerMbim, mm_bearer_mbim, MM_TYPE_BASE_BEARER) @@ -1181,8 +1182,12 @@ load_settings_from_bearer (MMBearerMbim *self, /* If no multiplex setting given by the user, assume none */ multiplex = mm_bearer_properties_get_multiplex (properties); - if (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN) - multiplex = MM_BEARER_MULTIPLEX_SUPPORT_NONE; + if (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN) { + if (mm_context_get_test_multiplex_requested ()) + multiplex = MM_BEARER_MULTIPLEX_SUPPORT_REQUESTED; + else + multiplex = MM_BEARER_MULTIPLEX_SUPPORT_NONE; + } if (multiplex_supported && (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_REQUESTED || diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c index f02cbf17..e1252ac2 100644 --- a/src/mm-bearer-qmi.c +++ b/src/mm-bearer-qmi.c @@ -34,6 +34,7 @@ #include "mm-port-enums-types.h" #include "mm-log-object.h" #include "mm-modem-helpers.h" +#include "mm-context.h" G_DEFINE_TYPE (MMBearerQmi, mm_bearer_qmi, MM_TYPE_BASE_BEARER) @@ -2147,7 +2148,9 @@ load_settings_from_bearer (MMBearerQmi *self, /* If no multiplex setting given by the user, assume none; unless in IPA */ ctx->multiplex = mm_bearer_properties_get_multiplex (properties); if (ctx->multiplex == MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN) { - if (!g_strcmp0 (data_port_driver, "ipa")) + if (mm_context_get_test_multiplex_requested ()) + ctx->multiplex = MM_BEARER_MULTIPLEX_SUPPORT_REQUESTED; + else if (!g_strcmp0 (data_port_driver, "ipa")) ctx->multiplex = MM_BEARER_MULTIPLEX_SUPPORT_REQUIRED; else ctx->multiplex = MM_BEARER_MULTIPLEX_SUPPORT_NONE; diff --git a/src/mm-context.c b/src/mm-context.c index 25b3a79c..8c341667 100644 --- a/src/mm-context.c +++ b/src/mm-context.c @@ -222,6 +222,7 @@ static gboolean test_quick_suspend_resume; #if defined WITH_QRTR static gboolean test_no_qrtr; #endif +static gboolean test_multiplex_requested; static const GOptionEntry test_entries[] = { { @@ -265,6 +266,11 @@ static const GOptionEntry test_entries[] = { NULL }, #endif + { + "test-multiplex-requested", 0, 0, G_OPTION_ARG_NONE, &test_multiplex_requested, + "Default to request multiplex support if no explicitly given", + NULL + }, { NULL } }; @@ -328,6 +334,13 @@ mm_context_get_test_no_qrtr (void) return test_no_qrtr; } #endif + +gboolean +mm_context_get_test_multiplex_requested (void) +{ + return test_multiplex_requested; +} + /*****************************************************************************/ static void diff --git a/src/mm-context.h b/src/mm-context.h index 0e652ba3..fefd574e 100644 --- a/src/mm-context.h +++ b/src/mm-context.h @@ -54,7 +54,8 @@ gboolean mm_context_get_test_no_suspend_resume (void); gboolean mm_context_get_test_quick_suspend_resume (void); #endif #if defined WITH_QRTR -gboolean mm_context_get_test_no_qrtr (void); +gboolean mm_context_get_test_no_qrtr (void); #endif +gboolean mm_context_get_test_multiplex_requested (void); #endif /* MM_CONTEXT_H */ |