diff options
author | Denis Kenzior <denkenz@gmail.com> | 2017-11-13 21:10:03 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2017-11-13 21:24:37 -0600 |
commit | 97e39299d0c17a0e8c99dac17112b342072f09f2 (patch) | |
tree | d7224dd624e94c065225d5d7a99c5e1fc2f1721c /src/gprs.c | |
parent | 2d164c38c430f9b8acb11bead20fa9bb51e2c634 (diff) | |
download | ofono-97e39299d0c17a0e8c99dac17112b342072f09f2.tar.gz |
gprs: Set Attached if no .read_settings
Some protocols (like MBIM) do not properly support default bearer
semantics. Instead they want everything to function like UMTS/GSM where
the context has to be explicitly attached / activated.
Diffstat (limited to 'src/gprs.c')
-rw-r--r-- | src/gprs.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -34,6 +34,7 @@ #include <net/route.h> #include <netinet/in.h> #include <arpa/inet.h> +#include <stdbool.h> #include <glib.h> #include <gdbus.h> @@ -1599,6 +1600,20 @@ static gboolean have_active_contexts(struct ofono_gprs *gprs) return FALSE; } +static bool have_read_settings(struct ofono_gprs *gprs) +{ + GSList *l; + + for (l = gprs->context_drivers; l; l = l->next) { + struct ofono_gprs_context *gc = l->data; + + if (gc->driver && gc->driver->read_settings) + return true; + } + + return false; +} + static void release_active_contexts(struct ofono_gprs *gprs) { GSList *l; @@ -1726,7 +1741,7 @@ static void gprs_netreg_update(struct ofono_gprs *gprs) DBG("attach: %u, driver_attached: %u", attach, gprs->driver_attached); if (ofono_netreg_get_technology(gprs->netreg) == - ACCESS_TECHNOLOGY_EUTRAN) + ACCESS_TECHNOLOGY_EUTRAN && have_read_settings(gprs)) /* * For LTE we set attached status only on successful * context activation. |