[PATCH 1/2] bearer-mbim: debug log NwError field on error

Bjørn Mork bjorn at mork.no
Thu Dec 19 03:55:50 PST 2013


It's rather hopeless to figure out why an operation failed
without the network cause code, so at least log it in the
debug log.

Signed-off-by: Bjørn Mork <bjorn at mork.no>
---
 src/mm-bearer-mbim.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
index 2cfd1cf..3446ed3 100644
--- a/src/mm-bearer-mbim.c
+++ b/src/mm-bearer-mbim.c
@@ -439,9 +439,10 @@ connect_set_ready (MbimDevice *device,
             NULL, /* context_type */
             &nw_error,
             &error)) {
-        if (nw_error)
+        if (nw_error) {
             error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error);
-        else {
+            mm_dbg ("NwError: '%s' (%u)", error->message, nw_error);
+        } else {
             ctx->ip_type = ip_type;
             mm_dbg ("Session ID '%u': %s (IP type: %s)",
                     session_id,
@@ -532,9 +533,10 @@ packet_service_set_ready (MbimDevice *device,
             &uplink_speed,
             &downlink_speed,
             &error)) {
-        if (nw_error)
+        if (nw_error) {
             error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error);
-        else {
+            mm_dbg ("NwError: '%s' (%u)", error->message, nw_error);
+        } else {
             gchar *str;
 
             str = mbim_data_class_build_string_from_mask (highest_available_data_class);
@@ -912,9 +914,10 @@ disconnect_set_ready (MbimDevice *device,
             NULL, /* context_type */
             &nw_error,
             &error)) {
-        if (nw_error)
+        if (nw_error) {
             error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error);
-        else
+            mm_dbg ("NwError: '%s' (%u)", error->message, nw_error);
+        } else
             mm_dbg ("Session ID '%u': %s",
                     session_id,
                     mbim_activation_state_get_string (activation_state));
-- 
1.7.10.4



More information about the ModemManager-devel mailing list