Hi Denis,

Den mån 12 aug. 2019 kl 18:58 skrev Denis Kenzior <[email protected]>:

> Hi Richard,
>
> On 8/11/19 9:58 AM, [email protected] wrote:
> > From: Richard Röjfors <[email protected]>
> >
> > There are cases where the gprs status might updated to for instance
> > "unknown" while LTE is the bearer.
> > In that case we should not set the attach state to FALSE,
> > since then running LTE the conext activation reflects the attached
> > state.
>
> It might be nice to include a log snippet of how the current behavior
> fails...
>

I'm not sure I can dig one up right now.

The case is that we are running LTE a context gets auto activated,
we don't bother to attach to GPRS (since we are on LTE), we get notified
that the
status is unknown -> BAM, we get detached, eventhough we are on LTE and the
context is up.


>
> > ---
> >   src/gprs.c | 19 ++++++++++++++++---
> >   1 file changed, 16 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/gprs.c b/src/gprs.c
> > index 9cb69d14..1a9b234d 100644
> > --- a/src/gprs.c
> > +++ b/src/gprs.c
> > @@ -1660,6 +1660,15 @@ static void gprs_netreg_removed(struct ofono_gprs
> *gprs)
> >       gprs_attached_update(gprs);
> >   }
> >
> > +static gboolean expect_lte_context_auto_activation(struct ofono_gprs
> *gprs)
>
> I'm not thrilled about the name?  Isn't this just 'on_lte?' or something
> like that?
>

Sounds better.


>
> > +{
> > +     if (ofono_netreg_get_technology(gprs->netreg) ==
> > +                     ACCESS_TECHNOLOGY_EUTRAN &&
> have_read_settings(gprs))
> > +             return TRUE;
> > +
> > +     return FALSE;
> > +}
> > +
> >   static void gprs_netreg_update(struct ofono_gprs *gprs)
> >   {
> >       ofono_bool_t attach;
> > @@ -1682,8 +1691,7 @@ static void gprs_netreg_update(struct ofono_gprs
> *gprs)
> >
> >       DBG("attach: %u, driver_attached: %u", attach,
> gprs->driver_attached);
> >
> > -     if (ofono_netreg_get_technology(gprs->netreg) ==
> > -                     ACCESS_TECHNOLOGY_EUTRAN &&
> have_read_settings(gprs))
> > +     if (expect_lte_context_auto_activation(gprs))
> >               /*
> >                * For LTE we set attached status only on successful
> >                * context activation.
> > @@ -2560,7 +2568,12 @@ void ofono_gprs_status_notify(struct ofono_gprs
> *gprs, int status)
> >
> >       if (status != NETWORK_REGISTRATION_STATUS_REGISTERED &&
> >                       status != NETWORK_REGISTRATION_STATUS_ROAMING) {
> > -             gprs_attached_update(gprs);
> > +             /*
> > +              * For LTE we attached status reflects successful context
> > +              * activation.
> > +              */
>
> So I don't get this.  We have CREG telling us: "we're on LTE" and CGREG
> telling us "Oh we don't know what our status is".  Why do you trust one
> and not the other?  Are you sure this doesn't belong in a driver quirk
> somewhere?
>

When CREG tells us we are on LTE, we will probably not even try attach to
gprs (CGATT),
refer to gprs_netreg_update.
In my understanding that means that its natural that CGREG reports unknown
or similar.
CEREG would be the interesting one... but since the code is built around
using activated context as condition when running on LTE I think we should
use the same condition here.


>
> > +             if (!expect_lte_context_auto_activation(gprs))
> > +                     gprs_attached_update(gprs);
> >               return;
> >       }
> >
> >
>
> Regards,
> -Denis
>
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to