aboutsummaryrefslogtreecommitdiff
path: root/src/mm-broadband-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-25 15:42:35 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-03-10 10:59:22 +0100
commit05b9ab7c25bf252e43037ed0ea002b0aed6f051b (patch)
tree996bf3a13e114298d450ce10136a6838d9f00006 /src/mm-broadband-modem.c
parent35e20a48c8b16ae744c4ca3082f70e8aa674c2f4 (diff)
api,modem: new 'MaxActiveMultiplexedBearers' property
In addition to the amount of bearers a user may connect without multiplexing enabled (the default until now), we now also expose the maximum number of bearers a user may connect after enabling multiplexing over one single network interface (if supported). The method responsible for creating the MMBearerList is now also subclassable, so that implementations supporting multiplexing can provide their own version with their own thresholds.
Diffstat (limited to 'src/mm-broadband-modem.c')
-rw-r--r--src/mm-broadband-modem.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 66320c63..bcd56faa 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -418,6 +418,23 @@ modem_create_bearer (MMIfaceModem *self,
}
/*****************************************************************************/
+/* Create Bearer List (Modem interface) */
+
+static MMBearerList *
+modem_create_bearer_list (MMIfaceModem *self)
+{
+ guint n;
+
+ /* The maximum number of available/connected modems is guessed from
+ * the size of the data ports list. */
+ n = g_list_length (mm_base_modem_peek_data_ports (MM_BASE_MODEM (self)));
+ mm_obj_dbg (self, "allowed up to %u active bearers", n);
+
+ /* by default, no multiplexing support */
+ return mm_bearer_list_new (n, 0);
+}
+
+/*****************************************************************************/
/* Create SIM (Modem interface) */
static MMBaseSim *
@@ -12425,6 +12442,7 @@ iface_modem_init (MMIfaceModem *iface)
iface->load_power_state_finish = modem_load_power_state_finish;
iface->load_supported_ip_families = modem_load_supported_ip_families;
iface->load_supported_ip_families_finish = modem_load_supported_ip_families_finish;
+ iface->create_bearer_list = modem_create_bearer_list;
/* Enabling steps */
iface->modem_power_up = modem_power_up;