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.
This commit is contained in:
@@ -215,6 +215,8 @@ typedef struct {
|
|||||||
ConnectStep step;
|
ConnectStep step;
|
||||||
MMPort *data;
|
MMPort *data;
|
||||||
MMBearerConnectResult *connect_result;
|
MMBearerConnectResult *connect_result;
|
||||||
|
guint64 uplink_speed;
|
||||||
|
guint64 downlink_speed;
|
||||||
/* settings to use */
|
/* settings to use */
|
||||||
gint profile_id;
|
gint profile_id;
|
||||||
gchar *apn;
|
gchar *apn;
|
||||||
@@ -578,6 +580,9 @@ ip_configuration_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
if (ctx->profile_id != MM_3GPP_PROFILE_ID_UNKNOWN)
|
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_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) {
|
if (error) {
|
||||||
@@ -815,8 +820,8 @@ packet_service_set_ready (MbimDevice *device,
|
|||||||
guint32 nw_error;
|
guint32 nw_error;
|
||||||
MbimPacketServiceState packet_service_state;
|
MbimPacketServiceState packet_service_state;
|
||||||
MbimDataClass data_class;
|
MbimDataClass data_class;
|
||||||
guint64 uplink_speed;
|
guint64 uplink_speed = 0;
|
||||||
guint64 downlink_speed;
|
guint64 downlink_speed = 0;
|
||||||
MbimFrequencyRange frequency_range = MBIM_FREQUENCY_RANGE_UNKNOWN;
|
MbimFrequencyRange frequency_range = MBIM_FREQUENCY_RANGE_UNKNOWN;
|
||||||
|
|
||||||
self = g_task_get_source_object (task);
|
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 */
|
/* Keep on */
|
||||||
ctx->step++;
|
ctx->step++;
|
||||||
connect_context_step (task);
|
connect_context_step (task);
|
||||||
|
Reference in New Issue
Block a user