* GPRS Attach/Detach
@ 2018-02-14 10:03 Nikolas Sepos
2018-02-14 16:54 ` Denis Kenzior
0 siblings, 1 reply; 5+ messages in thread
From: Nikolas Sepos @ 2018-02-14 10:03 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2555 bytes --]
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
nikolas(a)endocode.com
------
Endocode AG, Brückenstraße 5A, 10179 Berlin
info(a)endocode.com | www.endocode.com
Vorstandsvorsitzender: Mirko Boehm
Vorstände: Dr. Thomas Fricke, Sebastian Sucker
Aufsichtsratsvorsitzende: Alexandra Boehm
Registergericht: Amtsgericht
Charlottenburg - HRB 150748 B
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 5422 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: GPRS Attach/Detach
2018-02-14 10:03 GPRS Attach/Detach Nikolas Sepos
@ 2018-02-14 16:54 ` Denis Kenzior
2018-02-19 12:55 ` Nikolas Sepos
0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2018-02-14 16:54 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 815 bytes --]
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: GPRS Attach/Detach
2018-02-14 16:54 ` Denis Kenzior
@ 2018-02-19 12:55 ` Nikolas Sepos
2018-02-19 16:36 ` Denis Kenzior
0 siblings, 1 reply; 5+ messages in thread
From: Nikolas Sepos @ 2018-02-19 12:55 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 644 bytes --]
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.
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1547 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: GPRS Attach/Detach
2018-02-19 12:55 ` Nikolas Sepos
@ 2018-02-19 16:36 ` Denis Kenzior
2018-02-19 17:58 ` Nikolas Sepos
0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2018-02-19 16:36 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: GPRS Attach/Detach
2018-02-19 16:36 ` Denis Kenzior
@ 2018-02-19 17:58 ` Nikolas Sepos
0 siblings, 0 replies; 5+ messages in thread
From: Nikolas Sepos @ 2018-02-19 17:58 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]
Hi Denis,
thank you again.
All the best,
Nikolas.
---
Nikolas Sepos
DevOps Engineer @ Endocode AG
nikolas(a)endocode.com
------
Endocode AG, Brückenstraße 5A, 10179 Berlin
info(a)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 <denkenz@gmail.com> 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
>
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 4754 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-02-19 17:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14 10:03 GPRS Attach/Detach Nikolas Sepos
2018-02-14 16:54 ` Denis Kenzior
2018-02-19 12:55 ` Nikolas Sepos
2018-02-19 16:36 ` Denis Kenzior
2018-02-19 17:58 ` Nikolas Sepos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox