All of lore.kernel.org
 help / color / mirror / Atom feed
* [offline-atoms PATCHv2] Make gprs atom offline-safe.
@ 2011-01-20 13:37 Pekka.Pessi
  2011-01-20 15:59 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Pekka.Pessi @ 2011-01-20 13:37 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]

From: Pekka Pessi <Pekka.Pessi@nokia.com>

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.
---
 src/gprs.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index 0661f74..7153770 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1373,6 +1373,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;
@@ -2279,8 +2291,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;
 	}
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [offline-atoms PATCHv2] Make gprs atom offline-safe.
  2011-01-20 13:37 [offline-atoms PATCHv2] Make gprs atom offline-safe Pekka.Pessi
@ 2011-01-20 15:59 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-01-20 15:59 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

Hi Pekka,

On 01/20/2011 07:37 AM, Pekka.Pessi(a)nokia.com wrote:
> From: Pekka Pessi <Pekka.Pessi@nokia.com>
> 
> 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.
> ---
>  src/gprs.c |   15 +++++++++++++--
>  1 files changed, 13 insertions(+), 2 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-20 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20 13:37 [offline-atoms PATCHv2] Make gprs atom offline-safe Pekka.Pessi
2011-01-20 15:59 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.