summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-10-22 21:37:54 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-11-03 12:41:51 +0100
commit21c8cadb41881da707288e6364ecb60c0f80bd14 (patch)
treee68170bcf2074342eb1c951272dbb477873d60b4
parent16acff930bd406becc3825bd22630034c9c23cf3 (diff)
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.
-rw-r--r--src/mm-bearer-mbim.c13
1 files 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);