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.
This commit is contained in:
Aleksander Morgado
2021-07-29 00:07:27 +02:00
parent c49f3f5f46
commit 185e492c0a
4 changed files with 26 additions and 4 deletions

View File

@@ -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 ||

View File

@@ -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;

View File

@@ -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

View File

@@ -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 */