summaryrefslogtreecommitdiff
path: root/src/mm-bearer-mbim.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-05-16 23:23:30 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-05-22 22:58:37 +0000
commita878cfa0036f6c0608c3e17697edff08ccd9fab1 (patch)
tree9b4fe16bc78f1058ecbd80b62855356c8022ce21 /src/mm-bearer-mbim.c
parent8da8fd0248fa619709aa2a17b1717e7981b641d0 (diff)
modem-helpers-mbim: rework nw error code mapping
Instead of having a switch with a lot of cases, provide a one to one mapping for the MbimNwError and MMMobileEquipmentError codes in an array, and make use of the mm_mobile_equipment_error_for_code() helper to build the actual GError.
Diffstat (limited to 'src/mm-bearer-mbim.c')
-rw-r--r--src/mm-bearer-mbim.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
index e7747f32..ae4573ae 100644
--- a/src/mm-bearer-mbim.c
+++ b/src/mm-bearer-mbim.c
@@ -636,7 +636,7 @@ connect_set_ready (MbimDevice *device,
activation_state != MBIM_ACTIVATION_STATE_ACTIVATING) {
if (nw_error) {
g_clear_error (&error);
- error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error);
+ error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error, self);
} else if (!error) {
error = g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN,
@@ -843,7 +843,7 @@ packet_service_set_ready (MbimDevice *device,
&inner_error)) {
if (nw_error) {
g_clear_error (&error);
- error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error);
+ error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error, self);
} else {
g_autofree gchar *str = NULL;
@@ -1402,7 +1402,7 @@ disconnect_set_ready (MbimDevice *device,
if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE) && parsed_result && nw_error != 0) {
g_assert (!inner_error);
g_error_free (error);
- error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error);
+ error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error, self);
/* error out with nw_error error */
goto out;
}