diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2022-10-20 11:12:12 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2022-11-08 14:25:32 +0000 |
commit | 3e13044e10d4a560e586d1a6229512eff5a298ef (patch) | |
tree | 45d5d4e011a1efb345fb2d84176b01039779aa86 /src/mm-bearer-mbim.c | |
parent | c9bcaa3312cc97ec34c0c3b8af9af615ab064fa0 (diff) |
broadband-modem-mbim: track uplink/downlink speeds only via indications
The uplink and downlink speeds will be exclusively tracked via packet
service indications, and stored within the MBIM modem object.
When the bearer connect result is built, we will include the latest
speeds reported, which may have changed upon the operation to connect
to the network.
Diffstat (limited to 'src/mm-bearer-mbim.c')
-rw-r--r-- | src/mm-bearer-mbim.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index 8a8096a9..92b2b915 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -251,8 +251,6 @@ typedef struct { MMPort *data; MMBearerConnectResult *connect_result; MbimMessage *abort_on_failure; - guint64 uplink_speed; - guint64 downlink_speed; /* settings to use */ gint profile_id; gchar *apn; @@ -362,6 +360,8 @@ ip_configuration_query_ready (MbimDevice *device, g_autofree gchar *ipv6configurationavailable_str = NULL; g_autoptr(MMBearerIpConfig) ipv4_config = NULL; g_autoptr(MMBearerIpConfig) ipv6_config = NULL; + guint64 uplink_speed = 0; + guint64 downlink_speed = 0; /* IPv4 info */ @@ -626,8 +626,10 @@ ip_configuration_query_ready (MbimDevice *device, if (ctx->profile_id != MM_3GPP_PROFILE_ID_UNKNOWN) mm_bearer_connect_result_set_profile_id (ctx->connect_result, ctx->profile_id); - mm_bearer_connect_result_set_uplink_speed (ctx->connect_result, ctx->uplink_speed); - mm_bearer_connect_result_set_downlink_speed (ctx->connect_result, ctx->downlink_speed); + /* Propagate speeds from modem object */ + mm_broadband_modem_mbim_get_speeds (ctx->modem, &uplink_speed, &downlink_speed); + mm_bearer_connect_result_set_uplink_speed (ctx->connect_result, uplink_speed); + mm_bearer_connect_result_set_downlink_speed (ctx->connect_result, downlink_speed); } if (error) { @@ -1005,10 +1007,6 @@ packet_service_set_ready (MbimDevice *device, } } - /* store speeds to include in the connection result later on */ - ctx->uplink_speed = uplink_speed; - ctx->downlink_speed = downlink_speed; - /* Keep on */ ctx->step++; connect_context_step (task); |