All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [RFC] GPRS context setup and teardown (doc/dataconnectionmanager-api.txt)
Date: Sat, 24 Oct 2009 22:43:58 -0500	[thread overview]
Message-ID: <200910242243.59094.denkenz@gmail.com> (raw)
In-Reply-To: <fb249edb0910241702p2467ef4fgd09b9e42216dcfa7@mail.gmail.com>

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

Hi,

> > Lets suppose status=registered arrives and we're already attached.  Here
> > attached will be set to FALSE, Attached property will be set to false and
> > emitted.  gprs_netreg_update will presumably reset Attached back to True.
>
> Now I see it and you're absolutely right to be alerted, I set
> "attached" to the reverse of what it should be set to.  We're attached
> when we're either in REGISTERED or ROAMING state.  If I had done it
> right then the logic would look simple (I suppose):

I still don't believe that it works.  Suppose we're attached and registered.  
Now we get an indication that we're in 'searching' state.  set attach to true, 
compare with stored value (true).  Ah, don't do anything -> not good.

You also emit a signal that outright lies as to the current state.  Suppose 
we're registered and just the cellid / lac / technology changes.  This 
function still gets triggered and does a funky dance of emitting signals and 
calling into the driver to attach / detach.

>
> If either we already knew that we were in that state then there's
> nothing to do.  Otherwise we set the D-Bus property to reflect current
> state and call gprs_netreg_update to figure out if this is the state
> we really wanted to be in.

This part is fine, but lets make it easy to understand, e.g. do all of this 
inside gprs_netreg_update.

>
> If the notification indicates we were detached we will also need to
> reset all current contexts to inactive here, originally I did this in
> the driver.

Yes, this is one of the parts I forgot to port over :(

> This is a policy question, what do we do when the user disallowed
> roaming but the modem wants to roam?  If we decide that we will not
> retry to attach until the user pokes us again then "Powered" really
> should be reset to false because even if the conditions you listed are
> met we still won't attach.  Maybe instead we should do the retries
> with increasing timeouts like you mentioned in another message, and
> then "Powered" should stay set.

Resetting Powered in the core leads to strange situations where after coming 
from an overseas trip you'd need to reset Powered back to on.  I would find 
that annoying.

The nice thing is I don't think we need to play the attach/detach dance.  We 
can take advantage of the netreg atom's information.  If we're roaming there, 
we will be roaming on GPRS as well.  If we're registered there, then we should 
try to attach.

>
> An unrelated thing: you keep the allowed cid range in the core and
> only remember the min and max cid.  However I think (but don't know
> where to check for it) that +CGDCONT=? is free to return (1,2) instead
> of (1-2), or even (1-2,5-6,13).  Other AT commands do return ranges
> with this syntax.

You're absolutely correct that the syntax allows this.  My decision here was 
mostly a  matter of prudence.  I doubt any device actually uses a non-
contiguous cid range.  If/once we do find one that does, we can add a new 
set_sparse_range function (or something) in the core to take care of it.

Regards,
-Denis

  reply	other threads:[~2009-10-25  3:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12 21:35 [RFC] GPRS context setup and teardown (doc/dataconnectionmanager-api.txt) Andrzej Zaborowski
2009-10-12 20:01 ` Andrzej Zaborowski
2009-10-16 18:23   ` Denis Kenzior
2009-10-23 22:22 ` Denis Kenzior
2009-10-24  8:04   ` andrzej zaborowski
2009-10-24  8:18     ` Andrzej Zaborowski
2009-10-24 17:37       ` Denis Kenzior
2009-10-24 15:30     ` Denis Kenzior
2009-10-25  0:02       ` andrzej zaborowski
2009-10-25  3:43         ` Denis Kenzior [this message]
2009-10-25  6:39           ` andrzej zaborowski
2009-10-25  6:43             ` andrzej zaborowski

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=200910242243.59094.denkenz@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.