bearer-qmi: port to use object logging

This commit is contained in:
Aleksander Morgado
2020-03-29 19:25:25 +02:00
parent b2d3ff0b3d
commit ba89d59471

View File

@@ -31,7 +31,7 @@
#include "mm-bearer-qmi.h" #include "mm-bearer-qmi.h"
#include "mm-modem-helpers-qmi.h" #include "mm-modem-helpers-qmi.h"
#include "mm-port-enums-types.h" #include "mm-port-enums-types.h"
#include "mm-log.h" #include "mm-log-object.h"
#include "mm-modem-helpers.h" #include "mm-modem-helpers.h"
G_DEFINE_TYPE (MMBearerQmi, mm_bearer_qmi, MM_TYPE_BASE_BEARER) G_DEFINE_TYPE (MMBearerQmi, mm_bearer_qmi, MM_TYPE_BASE_BEARER)
@@ -537,11 +537,14 @@ start_network_ready (QmiClientWds *client,
GAsyncResult *res, GAsyncResult *res,
GTask *task) GTask *task)
{ {
MMBearerQmi *self;
ConnectContext *ctx; ConnectContext *ctx;
GError *error = NULL; GError *error = NULL;
QmiMessageWdsStartNetworkOutput *output; QmiMessageWdsStartNetworkOutput *output;
self = g_task_get_task_data (task);
ctx = g_task_get_task_data (task); ctx = g_task_get_task_data (task);
g_assert (ctx->running_ipv4 || ctx->running_ipv6); g_assert (ctx->running_ipv4 || ctx->running_ipv6);
g_assert (!(ctx->running_ipv4 && ctx->running_ipv6)); g_assert (!(ctx->running_ipv4 && ctx->running_ipv6));
@@ -565,7 +568,7 @@ start_network_ready (QmiClientWds *client,
/* Fall down to a successful connection */ /* Fall down to a successful connection */
} else { } else {
mm_info ("error: couldn't start network: %s", error->message); mm_obj_info (self, "couldn't start network: %s", error->message);
if (g_error_matches (error, if (g_error_matches (error,
QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR,
QMI_PROTOCOL_ERROR_CALL_FAILED)) { QMI_PROTOCOL_ERROR_CALL_FAILED)) {
@@ -577,16 +580,14 @@ start_network_ready (QmiClientWds *client,
output, output,
&cer, &cer,
NULL)) NULL))
mm_info ("call end reason (%u): '%s'", mm_obj_info (self, "call end reason (%u): %s", cer, qmi_wds_call_end_reason_get_string (cer));
cer,
qmi_wds_call_end_reason_get_string (cer));
if (qmi_message_wds_start_network_output_get_verbose_call_end_reason ( if (qmi_message_wds_start_network_output_get_verbose_call_end_reason (
output, output,
&verbose_cer_type, &verbose_cer_type,
&verbose_cer_reason, &verbose_cer_reason,
NULL)) NULL))
mm_info ("verbose call end reason (%u,%d): [%s] %s", mm_obj_info (self, "verbose call end reason (%u,%d): [%s] %s",
verbose_cer_type, verbose_cer_type,
verbose_cer_reason, verbose_cer_reason,
qmi_wds_verbose_call_end_reason_type_get_string (verbose_cer_type), qmi_wds_verbose_call_end_reason_type_get_string (verbose_cer_type),
@@ -693,7 +694,7 @@ get_ipv4_config (MMBearerQmi *self,
/* IPv4 subnet mask */ /* IPv4 subnet mask */
if (!qmi_message_wds_get_current_settings_output_get_ipv4_gateway_subnet_mask (output, &addr, &error)) { if (!qmi_message_wds_get_current_settings_output_get_ipv4_gateway_subnet_mask (output, &addr, &error)) {
mm_warn ("Failed to read IPv4 netmask (%s)", error->message); mm_obj_warn (self, "failed to read IPv4 netmask: %s", error->message);
g_clear_error (&error); g_clear_error (&error);
return NULL; return NULL;
} }
@@ -702,12 +703,12 @@ get_ipv4_config (MMBearerQmi *self,
/* IPv4 address */ /* IPv4 address */
if (!qmi_message_wds_get_current_settings_output_get_ipv4_address (output, &addr, &error)) { if (!qmi_message_wds_get_current_settings_output_get_ipv4_address (output, &addr, &error)) {
mm_warn ("IPv4 family but no IPv4 address (%s)", error->message); mm_obj_warn (self, "IPv4 family but no IPv4 address: %s", error->message);
g_clear_error (&error); g_clear_error (&error);
return NULL; return NULL;
} }
mm_info ("QMI IPv4 Settings:"); mm_obj_info (self, "QMI IPv4 Settings:");
config = mm_bearer_ip_config_new (); config = mm_bearer_ip_config_new ();
mm_bearer_ip_config_set_method (config, ip_method); mm_bearer_ip_config_set_method (config, ip_method);
@@ -716,15 +717,15 @@ get_ipv4_config (MMBearerQmi *self,
qmi_inet4_ntop (addr, buf, sizeof (buf)); qmi_inet4_ntop (addr, buf, sizeof (buf));
mm_bearer_ip_config_set_address (config, buf); mm_bearer_ip_config_set_address (config, buf);
mm_bearer_ip_config_set_prefix (config, prefix); mm_bearer_ip_config_set_prefix (config, prefix);
mm_info (" Address: %s/%d", buf, prefix); mm_obj_info (self, " address: %s/%d", buf, prefix);
/* IPv4 gateway address */ /* IPv4 gateway address */
if (qmi_message_wds_get_current_settings_output_get_ipv4_gateway_address (output, &addr, &error)) { if (qmi_message_wds_get_current_settings_output_get_ipv4_gateway_address (output, &addr, &error)) {
qmi_inet4_ntop (addr, buf, sizeof (buf)); qmi_inet4_ntop (addr, buf, sizeof (buf));
mm_bearer_ip_config_set_gateway (config, buf); mm_bearer_ip_config_set_gateway (config, buf);
mm_info (" Gateway: %s", buf); mm_obj_info (self, " gateway: %s", buf);
} else { } else {
mm_info (" Gateway: failed (%s)", error->message); mm_obj_info (self, " gateway: failed (%s)", error->message);
g_clear_error (&error); g_clear_error (&error);
} }
@@ -732,9 +733,9 @@ get_ipv4_config (MMBearerQmi *self,
if (qmi_message_wds_get_current_settings_output_get_primary_ipv4_dns_address (output, &addr, &error)) { if (qmi_message_wds_get_current_settings_output_get_primary_ipv4_dns_address (output, &addr, &error)) {
qmi_inet4_ntop (addr, buf, sizeof (buf)); qmi_inet4_ntop (addr, buf, sizeof (buf));
dns[dns_idx++] = buf; dns[dns_idx++] = buf;
mm_info (" DNS #1: %s", buf); mm_obj_info (self, " DNS #1: %s", buf);
} else { } else {
mm_info (" DNS #1: failed (%s)", error->message); mm_obj_info (self, " DNS #1: failed (%s)", error->message);
g_clear_error (&error); g_clear_error (&error);
} }
@@ -742,9 +743,9 @@ get_ipv4_config (MMBearerQmi *self,
if (qmi_message_wds_get_current_settings_output_get_secondary_ipv4_dns_address (output, &addr, &error)) { if (qmi_message_wds_get_current_settings_output_get_secondary_ipv4_dns_address (output, &addr, &error)) {
qmi_inet4_ntop (addr, buf2, sizeof (buf2)); qmi_inet4_ntop (addr, buf2, sizeof (buf2));
dns[dns_idx++] = buf2; dns[dns_idx++] = buf2;
mm_info (" DNS #2: %s", buf2); mm_obj_info (self, " DNS #2: %s", buf2);
} else { } else {
mm_info (" DNS #2: failed (%s)", error->message); mm_obj_info (self, " DNS #2: failed (%s)", error->message);
g_clear_error (&error); g_clear_error (&error);
} }
@@ -753,7 +754,7 @@ get_ipv4_config (MMBearerQmi *self,
if (mtu) { if (mtu) {
mm_bearer_ip_config_set_mtu (config, mtu); mm_bearer_ip_config_set_mtu (config, mtu);
mm_info (" MTU: %d", mtu); mm_obj_info (self, " MTU: %d", mtu);
} }
return config; return config;
@@ -795,12 +796,12 @@ get_ipv6_config (MMBearerQmi *self,
/* If the message has an IPv6 address, create an IPv6 bearer config */ /* If the message has an IPv6 address, create an IPv6 bearer config */
if (!qmi_message_wds_get_current_settings_output_get_ipv6_address (output, &array, &prefix, &error)) { if (!qmi_message_wds_get_current_settings_output_get_ipv6_address (output, &array, &prefix, &error)) {
mm_warn ("IPv6 family but no IPv6 address (%s)", error->message); mm_obj_warn (self, "IPv6 family but no IPv6 address: %s", error->message);
g_clear_error (&error); g_clear_error (&error);
return NULL; return NULL;
} }
mm_info ("QMI IPv6 Settings:"); mm_obj_info (self, "QMI IPv6 Settings:");
config = mm_bearer_ip_config_new (); config = mm_bearer_ip_config_new ();
mm_bearer_ip_config_set_method (config, ip_method); mm_bearer_ip_config_set_method (config, ip_method);
@@ -810,15 +811,15 @@ get_ipv6_config (MMBearerQmi *self,
mm_bearer_ip_config_set_address (config, buf); mm_bearer_ip_config_set_address (config, buf);
mm_bearer_ip_config_set_prefix (config, prefix); mm_bearer_ip_config_set_prefix (config, prefix);
mm_info (" Address: %s/%d", buf, prefix); mm_obj_info (self, " address: %s/%d", buf, prefix);
/* IPv6 gateway address */ /* IPv6 gateway address */
if (qmi_message_wds_get_current_settings_output_get_ipv6_gateway_address (output, &array, &prefix, &error)) { if (qmi_message_wds_get_current_settings_output_get_ipv6_gateway_address (output, &array, &prefix, &error)) {
qmi_inet6_ntop (array, buf, sizeof (buf)); qmi_inet6_ntop (array, buf, sizeof (buf));
mm_bearer_ip_config_set_gateway (config, buf); mm_bearer_ip_config_set_gateway (config, buf);
mm_info (" Gateway: %s/%d", buf, prefix); mm_obj_info (self, " gateway: %s/%d", buf, prefix);
} else { } else {
mm_info (" Gateway: failed (%s)", error->message); mm_obj_info (self, " gateway: failed (%s)", error->message);
g_clear_error (&error); g_clear_error (&error);
} }
@@ -826,9 +827,9 @@ get_ipv6_config (MMBearerQmi *self,
if (qmi_message_wds_get_current_settings_output_get_ipv6_primary_dns_address (output, &array, &error)) { if (qmi_message_wds_get_current_settings_output_get_ipv6_primary_dns_address (output, &array, &error)) {
qmi_inet6_ntop (array, buf, sizeof (buf)); qmi_inet6_ntop (array, buf, sizeof (buf));
dns[dns_idx++] = buf; dns[dns_idx++] = buf;
mm_info (" DNS #1: %s", buf); mm_obj_info (self, " DNS #1: %s", buf);
} else { } else {
mm_info (" DNS #1: failed (%s)", error->message); mm_obj_info (self, " DNS #1: failed (%s)", error->message);
g_clear_error (&error); g_clear_error (&error);
} }
@@ -836,9 +837,9 @@ get_ipv6_config (MMBearerQmi *self,
if (qmi_message_wds_get_current_settings_output_get_ipv6_secondary_dns_address (output, &array, &error)) { if (qmi_message_wds_get_current_settings_output_get_ipv6_secondary_dns_address (output, &array, &error)) {
qmi_inet6_ntop (array, buf2, sizeof (buf2)); qmi_inet6_ntop (array, buf2, sizeof (buf2));
dns[dns_idx++] = buf2; dns[dns_idx++] = buf2;
mm_info (" DNS #2: %s", buf2); mm_obj_info (self, " DNS #2: %s", buf2);
} else { } else {
mm_info (" DNS #2: failed (%s)", error->message); mm_obj_info (self, " DNS #2: failed (%s)", error->message);
g_clear_error (&error); g_clear_error (&error);
} }
@@ -847,7 +848,7 @@ get_ipv6_config (MMBearerQmi *self,
if (mtu) { if (mtu) {
mm_bearer_ip_config_set_mtu (config, mtu); mm_bearer_ip_config_set_mtu (config, mtu);
mm_info (" MTU: %d", mtu); mm_obj_info (self, " MTU: %d", mtu);
} }
return config; return config;
@@ -858,10 +859,12 @@ get_current_settings_ready (QmiClientWds *client,
GAsyncResult *res, GAsyncResult *res,
GTask *task) GTask *task)
{ {
MMBearerQmi *self;
ConnectContext *ctx; ConnectContext *ctx;
GError *error = NULL; GError *error = NULL;
QmiMessageWdsGetCurrentSettingsOutput *output; QmiMessageWdsGetCurrentSettingsOutput *output;
self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task); ctx = g_task_get_task_data (task);
g_assert (ctx->running_ipv4 || ctx->running_ipv6); g_assert (ctx->running_ipv4 || ctx->running_ipv6);
@@ -871,7 +874,7 @@ get_current_settings_ready (QmiClientWds *client,
/* When we're using static IP address, the current settings are mandatory */ /* When we're using static IP address, the current settings are mandatory */
if (ctx->ip_method == MM_BEARER_IP_METHOD_STATIC) { if (ctx->ip_method == MM_BEARER_IP_METHOD_STATIC) {
mm_warn ("Failed to retrieve mandatory IP settings: %s", error->message); mm_obj_warn (self, "failed to retrieve mandatory IP settings: %s", error->message);
if (output) if (output)
qmi_message_wds_get_current_settings_output_unref (output); qmi_message_wds_get_current_settings_output_unref (output);
complete_connect (task, NULL, error); complete_connect (task, NULL, error);
@@ -879,7 +882,7 @@ get_current_settings_ready (QmiClientWds *client,
} }
/* Otherwise, just go on as we're asking for DHCP */ /* Otherwise, just go on as we're asking for DHCP */
mm_dbg ("Couldn't get current settings: %s", error->message); mm_obj_dbg (self, "couldn't get current settings: %s", error->message);
g_error_free (error); g_error_free (error);
config = mm_bearer_ip_config_new (); config = mm_bearer_ip_config_new ();
@@ -897,16 +900,16 @@ get_current_settings_ready (QmiClientWds *client,
GArray *array; GArray *array;
if (!qmi_message_wds_get_current_settings_output_get_ip_family (output, &ip_family, &error)) { if (!qmi_message_wds_get_current_settings_output_get_ip_family (output, &ip_family, &error)) {
mm_dbg (" IP Family: failed (%s); assuming IPv4", error->message); mm_obj_dbg (self, " IP Family: failed (%s); assuming IPv4", error->message);
g_clear_error (&error); g_clear_error (&error);
ip_family = QMI_WDS_IP_FAMILY_IPV4; ip_family = QMI_WDS_IP_FAMILY_IPV4;
} }
mm_dbg (" IP Family: %s", mm_obj_dbg (self, " IP Family: %s",
(ip_family == QMI_WDS_IP_FAMILY_IPV4) ? "IPv4" : (ip_family == QMI_WDS_IP_FAMILY_IPV4) ? "IPv4" :
(ip_family == QMI_WDS_IP_FAMILY_IPV6) ? "IPv6" : "unknown"); (ip_family == QMI_WDS_IP_FAMILY_IPV6) ? "IPv6" : "unknown");
if (!qmi_message_wds_get_current_settings_output_get_mtu (output, &mtu, &error)) { if (!qmi_message_wds_get_current_settings_output_get_mtu (output, &mtu, &error)) {
mm_dbg (" MTU: failed (%s)", error->message); mm_obj_dbg (self, " MTU: failed (%s)", error->message);
g_clear_error (&error); g_clear_error (&error);
} }
@@ -925,10 +928,10 @@ get_current_settings_ready (QmiClientWds *client,
g_string_append (s, ", "); g_string_append (s, ", ");
g_string_append (s, g_array_index (array, const char *, i)); g_string_append (s, g_array_index (array, const char *, i));
} }
mm_dbg (" Domains: %s", s->str); mm_obj_dbg (self, " domains: %s", s->str);
g_string_free (s, TRUE); g_string_free (s, TRUE);
} else { } else {
mm_dbg (" Domains: failed (%s)", error ? error->message : "unknown"); mm_obj_dbg (self, " domains: failed (%s)", error ? error->message : "unknown");
g_clear_error (&error); g_clear_error (&error);
} }
} }
@@ -975,11 +978,14 @@ set_ip_family_ready (QmiClientWds *client,
GAsyncResult *res, GAsyncResult *res,
GTask *task) GTask *task)
{ {
MMBearerQmi *self;
ConnectContext *ctx; ConnectContext *ctx;
GError *error = NULL; GError *error = NULL;
QmiMessageWdsSetIpFamilyOutput *output; QmiMessageWdsSetIpFamilyOutput *output;
self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task); ctx = g_task_get_task_data (task);
g_assert (ctx->running_ipv4 || ctx->running_ipv6); g_assert (ctx->running_ipv4 || ctx->running_ipv6);
g_assert (!(ctx->running_ipv4 && ctx->running_ipv6)); g_assert (!(ctx->running_ipv4 && ctx->running_ipv6));
@@ -991,7 +997,7 @@ set_ip_family_ready (QmiClientWds *client,
if (error) { if (error) {
/* Ensure we add the IP family preference TLV */ /* Ensure we add the IP family preference TLV */
mm_dbg ("Couldn't set IP family preference: '%s'", error->message); mm_obj_dbg (self, "couldn't set IP family preference: %s", error->message);
g_error_free (error); g_error_free (error);
ctx->default_ip_family_set = FALSE; ctx->default_ip_family_set = FALSE;
} else { } else {
@@ -1029,16 +1035,14 @@ packet_service_status_indication_cb (QmiClientWds *client,
output, output,
&cer, &cer,
NULL)) NULL))
mm_info ("bearer call end reason (%u): '%s'", mm_obj_info (self, "bearer call end reason (%u): '%s'", cer, qmi_wds_call_end_reason_get_string (cer));
cer,
qmi_wds_call_end_reason_get_string (cer));
if (qmi_indication_wds_packet_service_status_output_get_verbose_call_end_reason ( if (qmi_indication_wds_packet_service_status_output_get_verbose_call_end_reason (
output, output,
&verbose_cer_type, &verbose_cer_type,
&verbose_cer_reason, &verbose_cer_reason,
NULL)) NULL))
mm_info ("bearer verbose call end reason (%u,%d): [%s] %s", mm_obj_info (self, "bearer verbose call end reason (%u,%d): [%s] %s",
verbose_cer_type, verbose_cer_type,
verbose_cer_reason, verbose_cer_reason,
qmi_wds_verbose_call_end_reason_type_get_string (verbose_cer_type), qmi_wds_verbose_call_end_reason_type_get_string (verbose_cer_type),
@@ -1077,7 +1081,7 @@ event_report_indication_cb (QmiClientWds *client,
QmiIndicationWdsEventReportOutput *output, QmiIndicationWdsEventReportOutput *output,
MMBearerQmi *self) MMBearerQmi *self)
{ {
mm_dbg ("Got QMI WDS event report"); mm_obj_dbg (self, "got QMI WDS event report");
} }
static guint static guint
@@ -1326,7 +1330,7 @@ connect_context_step (GTask *task)
else else
ctx->ip_method = MM_BEARER_IP_METHOD_DHCP; ctx->ip_method = MM_BEARER_IP_METHOD_DHCP;
mm_dbg ("Defaulting to use %s IP method", mm_bearer_ip_method_get_string (ctx->ip_method)); mm_obj_dbg (self, "defaulting to use %s IP method", mm_bearer_ip_method_get_string (ctx->ip_method));
ctx->step++; ctx->step++;
/* fall through */ /* fall through */
@@ -1339,7 +1343,7 @@ connect_context_step (GTask *task)
} }
/* Start IPv4 setup */ /* Start IPv4 setup */
mm_dbg ("Running IPv4 connection setup"); mm_obj_dbg (self, "running IPv4 connection setup");
ctx->running_ipv4 = TRUE; ctx->running_ipv4 = TRUE;
ctx->running_ipv6 = FALSE; ctx->running_ipv6 = FALSE;
ctx->step++; ctx->step++;
@@ -1352,7 +1356,7 @@ connect_context_step (GTask *task)
QMI_SERVICE_WDS, QMI_SERVICE_WDS,
MM_PORT_QMI_FLAG_WDS_IPV4); MM_PORT_QMI_FLAG_WDS_IPV4);
if (!client) { if (!client) {
mm_dbg ("Allocating IPv4-specific WDS client"); mm_obj_dbg (self, "allocating IPv4-specific WDS client");
mm_port_qmi_allocate_client (ctx->qmi, mm_port_qmi_allocate_client (ctx->qmi,
QMI_SERVICE_WDS, QMI_SERVICE_WDS,
MM_PORT_QMI_FLAG_WDS_IPV4, MM_PORT_QMI_FLAG_WDS_IPV4,
@@ -1372,7 +1376,7 @@ connect_context_step (GTask *task)
qmi_client_check_version (QMI_CLIENT (ctx->client_ipv4), 1, 9)) { qmi_client_check_version (QMI_CLIENT (ctx->client_ipv4), 1, 9)) {
QmiMessageWdsSetIpFamilyInput *input; QmiMessageWdsSetIpFamilyInput *input;
mm_dbg ("Setting default IP family to: IPv4"); mm_obj_dbg (self, "setting default IP family to: IPv4");
input = qmi_message_wds_set_ip_family_input_new (); input = qmi_message_wds_set_ip_family_input_new ();
qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV4, NULL); qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV4, NULL);
qmi_client_wds_set_ip_family (ctx->client_ipv4, qmi_client_wds_set_ip_family (ctx->client_ipv4,
@@ -1405,7 +1409,7 @@ connect_context_step (GTask *task)
case CONNECT_STEP_START_NETWORK_IPV4: { case CONNECT_STEP_START_NETWORK_IPV4: {
QmiMessageWdsStartNetworkInput *input; QmiMessageWdsStartNetworkInput *input;
mm_dbg ("Starting IPv4 connection..."); mm_obj_dbg (self, "starting IPv4 connection...");
input = build_start_network_input (ctx); input = build_start_network_input (ctx);
qmi_client_wds_start_network (ctx->client_ipv4, qmi_client_wds_start_network (ctx->client_ipv4,
input, input,
@@ -1420,7 +1424,7 @@ connect_context_step (GTask *task)
case CONNECT_STEP_GET_CURRENT_SETTINGS_IPV4: case CONNECT_STEP_GET_CURRENT_SETTINGS_IPV4:
/* Retrieve and print IP configuration */ /* Retrieve and print IP configuration */
if (ctx->packet_data_handle_ipv4) { if (ctx->packet_data_handle_ipv4) {
mm_dbg ("Getting IPv4 configuration..."); mm_obj_dbg (self, "getting IPv4 configuration...");
get_current_settings (task, ctx->client_ipv4); get_current_settings (task, ctx->client_ipv4);
return; return;
} }
@@ -1436,7 +1440,7 @@ connect_context_step (GTask *task)
} }
/* Start IPv6 setup */ /* Start IPv6 setup */
mm_dbg ("Running IPv6 connection setup"); mm_obj_dbg (self, "running IPv6 connection setup");
ctx->running_ipv4 = FALSE; ctx->running_ipv4 = FALSE;
ctx->running_ipv6 = TRUE; ctx->running_ipv6 = TRUE;
ctx->step++; ctx->step++;
@@ -1449,7 +1453,7 @@ connect_context_step (GTask *task)
QMI_SERVICE_WDS, QMI_SERVICE_WDS,
MM_PORT_QMI_FLAG_WDS_IPV6); MM_PORT_QMI_FLAG_WDS_IPV6);
if (!client) { if (!client) {
mm_dbg ("Allocating IPv6-specific WDS client"); mm_obj_dbg (self, "allocating IPv6-specific WDS client");
mm_port_qmi_allocate_client (ctx->qmi, mm_port_qmi_allocate_client (ctx->qmi,
QMI_SERVICE_WDS, QMI_SERVICE_WDS,
MM_PORT_QMI_FLAG_WDS_IPV6, MM_PORT_QMI_FLAG_WDS_IPV6,
@@ -1471,7 +1475,7 @@ connect_context_step (GTask *task)
if (qmi_client_check_version (QMI_CLIENT (ctx->client_ipv6), 1, 9)) { if (qmi_client_check_version (QMI_CLIENT (ctx->client_ipv6), 1, 9)) {
QmiMessageWdsSetIpFamilyInput *input; QmiMessageWdsSetIpFamilyInput *input;
mm_dbg ("Setting default IP family to: IPv6"); mm_obj_dbg (self, "setting default IP family to: IPv6");
input = qmi_message_wds_set_ip_family_input_new (); input = qmi_message_wds_set_ip_family_input_new ();
qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV6, NULL); qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV6, NULL);
qmi_client_wds_set_ip_family (ctx->client_ipv6, qmi_client_wds_set_ip_family (ctx->client_ipv6,
@@ -1504,7 +1508,7 @@ connect_context_step (GTask *task)
case CONNECT_STEP_START_NETWORK_IPV6: { case CONNECT_STEP_START_NETWORK_IPV6: {
QmiMessageWdsStartNetworkInput *input; QmiMessageWdsStartNetworkInput *input;
mm_dbg ("Starting IPv6 connection..."); mm_obj_dbg (self, "starting IPv6 connection...");
input = build_start_network_input (ctx); input = build_start_network_input (ctx);
qmi_client_wds_start_network (ctx->client_ipv6, qmi_client_wds_start_network (ctx->client_ipv6,
input, input,
@@ -1519,7 +1523,7 @@ connect_context_step (GTask *task)
case CONNECT_STEP_GET_CURRENT_SETTINGS_IPV6: case CONNECT_STEP_GET_CURRENT_SETTINGS_IPV6:
/* Retrieve and print IP configuration */ /* Retrieve and print IP configuration */
if (ctx->packet_data_handle_ipv6) { if (ctx->packet_data_handle_ipv6) {
mm_dbg ("Getting IPv6 configuration..."); mm_obj_dbg (self, "getting IPv6 configuration...");
get_current_settings (task, ctx->client_ipv6); get_current_settings (task, ctx->client_ipv6);
return; return;
} }
@@ -1677,10 +1681,8 @@ _connect (MMBaseBearer *_self,
goto out; goto out;
} }
mm_dbg ("Launching connection with QMI port (%s/%s) and data port (%s/%s)", mm_obj_dbg (self, "launching connection with QMI port (%s) and data port (%s)",
mm_port_subsys_get_string (mm_port_get_subsys (MM_PORT (qmi))),
mm_port_get_device (MM_PORT (qmi)), mm_port_get_device (MM_PORT (qmi)),
mm_port_subsys_get_string (mm_port_get_subsys (data)),
mm_port_get_device (data)); mm_port_get_device (data));
ctx = g_slice_new0 (ConnectContext); ctx = g_slice_new0 (ConnectContext);
@@ -1714,8 +1716,7 @@ _connect (MMBaseBearer *_self,
ip_family = mm_base_bearer_get_default_ip_family (_self); ip_family = mm_base_bearer_get_default_ip_family (_self);
ip_family_str = mm_bearer_ip_family_build_string_from_mask (ip_family); ip_family_str = mm_bearer_ip_family_build_string_from_mask (ip_family);
mm_dbg ("No specific IP family requested, defaulting to %s", mm_obj_dbg (self, "no specific IP family requested, defaulting to %s", ip_family_str);
ip_family_str);
ctx->no_ip_family_preference = TRUE; ctx->no_ip_family_preference = TRUE;
g_free (ip_family_str); g_free (ip_family_str);
} }
@@ -2061,7 +2062,7 @@ disconnect (MMBaseBearer *_self,
(!self->priv->client_ipv4 && !self->priv->client_ipv6) || (!self->priv->client_ipv4 && !self->priv->client_ipv6) ||
!self->priv->data || !self->priv->data ||
!self->priv->qmi) { !self->priv->qmi) {
mm_dbg ("No need to disconnect: QMI bearer is already disconnected"); mm_obj_dbg (self, "no need to disconnect: QMI bearer is already disconnected");
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
g_object_unref (task); g_object_unref (task);
return; return;