diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2011-01-20 15:37:11 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-01-20 09:58:52 -0600 |
commit | a847f2ac0f4d0b11041907eb8e78cf701294043b (patch) | |
tree | f9494a38b1fb8b5c3cbbab1e06dc4eff01c0a723 /src/gprs.c | |
parent | 962eef48563c2f22cb3b7979ba0497be7f7dda70 (diff) | |
download | ofono-a847f2ac0f4d0b11041907eb8e78cf701294043b.tar.bz2 |
gprs: Make gprs atom offline-safe
Allow use of GPRS atom both in online and offline (post_sim) states.
The GPRS now considers the removal of the netreg atom as implicit detach
and registration change to NOT_REGISTERED.
Diffstat (limited to 'src/gprs.c')
-rw-r--r-- | src/gprs.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1408,6 +1408,18 @@ static void gprs_attach_callback(const struct ofono_error *error, void *data) } } +static void gprs_netreg_removed(struct ofono_gprs *gprs) +{ + gprs->netreg = NULL; + + gprs->flags &= ~(GPRS_FLAG_RECHECK | GPRS_FLAG_ATTACHING); + gprs->status_watch = 0; + gprs->netreg_status = NETWORK_REGISTRATION_STATUS_NOT_REGISTERED; + gprs->driver_attached = FALSE; + + gprs_attached_update(gprs); +} + static void gprs_netreg_update(struct ofono_gprs *gprs) { ofono_bool_t attach; @@ -2314,8 +2326,7 @@ static void netreg_watch(struct ofono_atom *atom, struct ofono_gprs *gprs = data; if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) { - gprs->status_watch = 0; - gprs->netreg = NULL; + gprs_netreg_removed(gprs); return; } |