From ce84ea510f5213e526917db2d7218d4ca001089d Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 17 Jun 2013 08:29:15 +0200 Subject: [PATCH] bearer-mbim: make packet service attach operation optional Some modems do require it, but some others won't (e.g. CDMA based ones), so just make the operation optional, but only if the modem replies NoDeviceSupport. https://bugzilla.gnome.org/show_bug.cgi?id=702419 --- src/mm-bearer-mbim.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index 8b64a4c0..2cfd1cfa 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -548,9 +548,17 @@ packet_service_set_ready (MbimDevice *device, } if (error) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); - return; + /* Don't make NoDeviceSupport errors fatal; just try to keep on the + * connection sequence even with this error. */ + if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_NO_DEVICE_SUPPORT)) { + mm_dbg ("Device doesn't support packet service attach"); + g_error_free (error); + } else { + /* All other errors are fatal */ + g_simple_async_result_take_error (ctx->result, error); + connect_context_complete_and_free (ctx); + return; + } } /* Keep on */