From 21c8cadb41881da707288e6364ecb60c0f80bd14 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 22 Oct 2021 21:37:54 +0200 Subject: [PATCH] bearer-mbim: implement support for 'uplink-speed' and 'downlink-speed' During the packet service attach operation we'll get notified of which is the agreed uplink/downlink bitrates, so include them in the stats. --- src/mm-bearer-mbim.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index e45b242e..36848ee3 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -215,6 +215,8 @@ typedef struct { ConnectStep step; MMPort *data; MMBearerConnectResult *connect_result; + guint64 uplink_speed; + guint64 downlink_speed; /* settings to use */ gint profile_id; gchar *apn; @@ -578,6 +580,9 @@ 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); } if (error) { @@ -815,8 +820,8 @@ packet_service_set_ready (MbimDevice *device, guint32 nw_error; MbimPacketServiceState packet_service_state; MbimDataClass data_class; - guint64 uplink_speed; - guint64 downlink_speed; + guint64 uplink_speed = 0; + guint64 downlink_speed = 0; MbimFrequencyRange frequency_range = MBIM_FREQUENCY_RANGE_UNKNOWN; self = g_task_get_source_object (task); @@ -887,6 +892,10 @@ 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);