From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [offline-atoms PATCH 1/2] Make gprs atom offline-safe.
Date: Tue, 18 Jan 2011 22:04:13 -0600 [thread overview]
Message-ID: <4D3662BD.1060604@gmail.com> (raw)
In-Reply-To: <1295016053-31994-2-git-send-email-Pekka.Pessi@nokia.com>
[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]
Hi Pekka,
On 01/14/2011 08:40 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 | 20 ++++++++++++++++++--
> 1 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/src/gprs.c b/src/gprs.c
> index 0e86bdf..35cc475 100644
> --- a/src/gprs.c
> +++ b/src/gprs.c
> @@ -1370,10 +1370,27 @@ 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;
>
> + if (gprs->netreg == NULL) {
> + gprs_netreg_removed(gprs);
> + return;
> + }
> +
I'm having trouble visualizing why this chunk is necessary. We reset
netreg to NULL only when shutting down the atom or when netreg atom goes
away. So this condition should never be triggered.
> attach = gprs->netreg_status == NETWORK_REGISTRATION_STATUS_REGISTERED;
>
> attach = attach || (gprs->roaming_allowed &&
> @@ -2250,8 +2267,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;
> }
>
Otherwise the rest seems fine to me.
Regards,
-Denis
next prev parent reply other threads:[~2011-01-19 4:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 14:40 [offline-atoms PATCH 0/2] Pekka.Pessi
2011-01-14 14:40 ` [offline-atoms PATCH 1/2] Make gprs atom offline-safe Pekka.Pessi
2011-01-14 14:40 ` [offline-atoms PATCH 2/2] Make sms " Pekka.Pessi
2011-01-19 4:10 ` Denis Kenzior
2011-01-19 4:04 ` Denis Kenzior [this message]
2011-01-19 13:33 ` [offline-atoms PATCH 1/2] Make gprs " Pekka Pessi
2011-01-19 16:57 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D3662BD.1060604@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.