diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2023-06-15 08:27:13 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2023-06-16 20:58:04 +0000 |
commit | 3004a3e53263625da0b26e50c9107f1bad5b371e (patch) | |
tree | e9377da944a3ec31e6b297d407716a998f8928fd /src/mm-broadband-modem-qmi.c | |
parent | 547d40009c665d523e15cabfee028fc2604660dd (diff) |
broadband-modem-qmi|mbim: allow limiting multiplexed links with udev tags
Certain QMI or MBIM devices may not be able to support multiplexing at
all, or they may support a limited amount of links.
The new ID_MM_MAX_MULTIPLEXED_LINKS udev tag allows specifying the
maximum number of supported multiplexed links; e.g. 0 to report none
supported or 1 to report that one single multiplexed link is
supported.
Diffstat (limited to 'src/mm-broadband-modem-qmi.c')
-rw-r--r-- | src/mm-broadband-modem-qmi.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index 95cc56b0..153b420e 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -27,6 +27,7 @@ #include "mm-broadband-modem-qmi.h" #include "ModemManager.h" +#include <ModemManager-tags.h> #include "mm-log.h" #include "mm-errors-types.h" #include "mm-modem-helpers.h" @@ -435,10 +436,22 @@ modem_create_bearer_list (MMIfaceModem *self) } if (kernel_data_modes & (MM_PORT_QMI_KERNEL_DATA_MODE_MUX_RMNET | MM_PORT_QMI_KERNEL_DATA_MODE_MUX_QMIWWAN)) { - /* The maximum number of multiplexed links is retrieved from the - * MMPortQmi */ + /* The maximum number of multiplexed links is retrieved from the MMPortQmi */ n_multiplexed = mm_port_qmi_get_max_multiplexed_links (port); mm_obj_dbg (self, "allowed up to %u active multiplexed bearers", n_multiplexed); + + if (mm_kernel_device_has_global_property (mm_port_peek_kernel_device (MM_PORT (port)), + ID_MM_MAX_MULTIPLEXED_LINKS)) { + guint n_multiplexed_limited; + + n_multiplexed_limited = mm_kernel_device_get_global_property_as_int ( + mm_port_peek_kernel_device (MM_PORT (port)), + ID_MM_MAX_MULTIPLEXED_LINKS); + if (n_multiplexed_limited < n_multiplexed) { + n_multiplexed = n_multiplexed_limited; + mm_obj_dbg (self, "limited to %u active multiplexed bearers", n_multiplexed); + } + } } } |