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 10:30:20 -0500	[thread overview]
Message-ID: <200910241030.21466.denkenz@gmail.com> (raw)
In-Reply-To: <fb249edb0910240104x3d994b16u39d8277a0c9a997e@mail.gmail.com>

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

Hi Andrew,
> > in set_registration_status:
> >        attached = (status != NETWORK_REGISTRATION_STATUS_REGISTERED &&
> >                        status != NETWORK_REGISTRATION_STATUS_ROAMING);
> >        if (gprs->attached != (int) attached &&
> >                        !(gprs->flags & GPRS_FLAG_ATTACHING)) {
> >                gprs->attached = (int) attached;
> >
> >                ofono_dbus_signal_property_changed(conn, path,
> >                                DATA_CONNECTION_MANAGER_INTERFACE,
> >                                "Attached", DBUS_TYPE_BOOLEAN,
> >                                &attached);
> >
> >                gprs_netreg_update(gprs);
> >        }
> >
> > I do not understand this logic at all.  Can't we always call
> > gprs_netreg_update here?
>
> Sure, but it won't do anything, if either "attached" state hasn't
> changed at all or it's already busy executing +CGATT.

So the issue here is that I can actually understand what gprs_netreg_update 
does.  This function I'm having trouble with.

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.  Why 
do this for a potentially spurious indication?  Remember your status might be 
indicated when just the network access technology has changed.

Another case.  We're detached (Powered=True, RoamingAllowed=False) and are 
currently Roaming.  Then status=searching arrives.  We report Attached as 
True.

Am I properly outlining the logic or am I missing something?  Again, explain 
the intention here.  Either way, the current logic is way too complicated and 
needs to be simplified.

>
> > In my opinion Attached should only be emitted once
> > it really has changed (e.g. in the callback)
>
> Often there's no other notification telling us that we were detached,
> so we must take any sign of it into account (it might be broken modems
> but I've seen such situations on both modems that I've tested it with)

For situations where we are forcefully detached and/or go into a non-
registered state, the core should take care of this.  If it is a modem not 
reporting this properly, then I'd argue this is something the driver needs to 
take care of.  If the core starts trying to guess / outwit every single broken 
hardware out there it will be unmaintainable.  Lets at least try to keep the 
core clean and only responsible for the things mandated by the relevant 
standards.

>
> > gprs_netreg_update:
> >                /* Prevent further attempts to attach */
> >                if (!attach && gprs->powered) {
> >                        gprs->powered = 0;
> >
> >                        path = __ofono_atom_get_path(gprs->atom);
> >                        ofono_dbus_signal_property_changed(conn, path,
> >                                        DATA_CONNECTION_MANAGER_INTERFACE,
> >                                        "Powered", DBUS_TYPE_BOOLEAN,
> > &value); }
> >
> > This is just too evil.  Can't we set another flag that attached
> > conditions have changed while we were attaching/detaching and that we
> > should recheck those conditions when we return from attach/detach?
>
> Is it evil because we change a property that is writable?

Yes, and also because this is a hack :)

>
> This is only for the case of RoamingAllowed = 0.  In my understanding
> "Powered" being set means that we're attached or attempting to attach,

No, Powered means GPRS is on assuming all conditions are fulfilled (e.g. 
registration, roaming, network resources)  This is a user setting that will be 
persisted (in IMSI based storage.)  It should not be spuriously changed by the 
daemon.

> which is not the case after we detached because of roaming, so the
> D-Bus client would be misled.

No, 'Attached' is what is used for this purpose.

Both patches have been applied.  Thanks!

Regards,
-Denis

  parent reply	other threads:[~2009-10-24 15:30 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 [this message]
2009-10-25  0:02       ` andrzej zaborowski
2009-10-25  3:43         ` Denis Kenzior
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=200910241030.21466.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.