Re: GPRS Attach/Detach

2018-02-19 Thread Nikolas Sepos
Hi Denis,

thank you again.

All the best,
Nikolas.

---

Nikolas Sepos
DevOps Engineer @ Endocode AG
niko...@endocode.com

--
Endocode AG, Brückenstraße 5A, 10179 Berlin
i...@endocode.com | www.endocode.com

Vorstandsvorsitzender: Mirko Boehm
Vorstände: Dr. Thomas Fricke, Sebastian Sucker
Aufsichtsratsvorsitzende: Alexandra Boehm

Registergericht: Amtsgericht
Charlottenburg - HRB 150748 B

On Mon, Feb 19, 2018 at 5:36 PM, Denis Kenzior  wrote:

> Hi Nikolas,
>
> On 02/19/2018 06:55 AM, Nikolas Sepos wrote:
>
>> Hello Denis,
>>
>> thank you very much for the reply.
>>
>> Doesn't seem to have anything to do with PPP actually.  Anyway,
>> there should be no active contexts if we're detached.  Otherwise
>> this will confuse ConnMan, NetworkManager, etc.
>> Aren't ConnMan & NetworkManager get the info regarding modems state etc.
>> from ofono? How can this confuse them? (excuse my ignorance)
>>
>
> The global Attached status as well as whether a particular context is
> Active are signaled over D-Bus.  There should be no active contexts if
> we're detached.  Unfortunately the firmware on many modems does not make
> such guarantees.  So oFono core tries pretty hard to make sure that a
> consistent state is signaled, e.g. no active contexts when detached.
>
>
>> The core tries to work around some of the more common issues, but
>> ultimately the driver needs to make sure the transitions are well
>> behaved.
>>
>>
>> Shouldn't this behavior  be handled by the drivers directly instead of
>> the core?
>>
>>
> Ideally yes, but this is not what you were asking originally.
>
> Regards,
> -Denis
>
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


Re: GPRS Attach/Detach

2018-02-19 Thread Denis Kenzior

Hi Nikolas,

On 02/19/2018 06:55 AM, Nikolas Sepos wrote:

Hello Denis,

thank you very much for the reply.

Doesn't seem to have anything to do with PPP actually.  Anyway,
there should be no active contexts if we're detached.  Otherwise
this will confuse ConnMan, NetworkManager, etc. 

Aren't ConnMan & NetworkManager get the info regarding modems state etc. 
from ofono? How can this confuse them? (excuse my ignorance)


The global Attached status as well as whether a particular context is 
Active are signaled over D-Bus.  There should be no active contexts if 
we're detached.  Unfortunately the firmware on many modems does not make 
such guarantees.  So oFono core tries pretty hard to make sure that a 
consistent state is signaled, e.g. no active contexts when detached.




The core tries to work around some of the more common issues, but
ultimately the driver needs to make sure the transitions are well
behaved.


Shouldn't this behavior  be handled by the drivers directly instead of 
the core?




Ideally yes, but this is not what you were asking originally.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


Re: GPRS Attach/Detach

2018-02-19 Thread Nikolas Sepos
Hello Denis,

thank you very much for the reply.


> Doesn't seem to have anything to do with PPP actually.  Anyway, there
> should be no active contexts if we're detached.  Otherwise this will
> confuse ConnMan, NetworkManager, etc.


Aren't ConnMan & NetworkManager get the info regarding modems state etc.
from ofono? How can this confuse them? (excuse my ignorance)

The core tries to work around some of the more common issues, but
> ultimately the driver needs to make sure the transitions are well behaved.
>

Shouldn't this behavior  be handled by the drivers directly instead of the
core?

All the best,
Nikolas.
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


Re: GPRS Attach/Detach

2018-02-14 Thread Denis Kenzior

Hi Nikolas,

I had to remove the `else if (have_active_contexts(gprs) == TRUE) { ... 
}` block because when attached was TRUE i still had active context and i 
didn't want it to be deactivated.


This particular logic was added in commit:
154f4aca65b3b419239be75d0def276bd7f4dc8e



As the comments say it's to mitigate some PPP issues. Should that be the 
case for all type of connections? What if my connection is RNDIS and not 
PPP?




Doesn't seem to have anything to do with PPP actually.  Anyway, there 
should be no active contexts if we're detached.  Otherwise this will 
confuse ConnMan, NetworkManager, etc.  The core tries to work around 
some of the more common issues, but ultimately the driver needs to make 
sure the transitions are well behaved.


Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


GPRS Attach/Detach

2018-02-14 Thread Nikolas Sepos
Hello ofono maintainers,

i had an issue with a modem and the GPRS attach/detach command. It was
hanging my modem for 3 seconds (modem issue not ofono). So in order to work
around it i implemented attach and detach as NoOp (not sending
AT+CGATT=0/1) but still had to callback to ofono that i am attached or
detached. But in order for that to make it work i had to patch src/gprs.c

Here is the function i made changes to:

static void gprs_attached_update(struct ofono_gprs *gprs)
{
ofono_bool_t attached;

attached = gprs->driver_attached &&
(gprs->status == NETWORK_REGISTRATION_STATUS_REGISTERED ||
gprs->status ==
NETWORK_REGISTRATION_STATUS_ROAMING);

if (attached == gprs->attached)
return;

/*
 * If an active context is found, a PPP session might be still
active
 * at driver level. "Attached" = TRUE property can't be signalled to
 * the applications registered on GPRS properties.
 * Active contexts have to be release at driver level.
 */
if (attached == FALSE) {
release_active_contexts(gprs);
gprs->bearer = -1;
} else if (have_active_contexts(gprs) == TRUE) {
/*
 * Some times the context activates after a detach event and
 * right before an attach. We close it to avoid unexpected
open
 * contexts.
 */
release_active_contexts(gprs);
gprs->flags |= GPRS_FLAG_ATTACHED_UPDATE;
return;
}

gprs_set_attached_property(gprs, attached);
}


I had to remove the `else if (have_active_contexts(gprs) == TRUE) { ... }`
block because when attached was TRUE i still had active context and i
didn't want it to be deactivated.

As the comments say it's to mitigate some PPP issues. Should that be the
case for all type of connections? What if my connection is RNDIS and not
PPP?

I hope i explained this well enough. If not please ask me to explain more.

Looking forward to your reply.

All the best,

---

Nikolas Sepos
DevOps Engineer @ Endocode AG
niko...@endocode.com

--
Endocode AG, Brückenstraße 5A, 10179 Berlin
i...@endocode.com | www.endocode.com

Vorstandsvorsitzender: Mirko Boehm
Vorstände: Dr. Thomas Fricke, Sebastian Sucker
Aufsichtsratsvorsitzende: Alexandra Boehm

Registergericht: Amtsgericht
Charlottenburg - HRB 150748 B
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono