All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guillaume Zajac <guillaume.zajac@linux.intel.com>
To: ofono@ofono.org
Subject: Re: Emulator not unregistered while sending ATH0
Date: Thu, 19 May 2011 14:58:09 +0200	[thread overview]
Message-ID: <4DD513E1.7000306@linux.intel.com> (raw)
In-Reply-To: <4DD5093F.6050307@linux.intel.com>

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

Hi again Denis,

I have found the issue I will submit a fix.
See explanations below.

On 19/05/2011 14:12, Guillaume Zajac wrote:
> Hi Denis,
>
> I have mixed some stuff concerning GIOChannels...
>
> On 19/05/2011 12:13, Guillaume Zajac wrote:
>> Hi Denis,
>>
>> I noticed that when I send +++ -> ATH0 during a PPP session the ppp 
>> server is well unregistered.
>> However when the physical layer is removed (bluetooht or TCP), the 
>> associated emulator is not unregistered.
>> As we used in gatutil.c set_close_on_unref(TRUE), it means there is 
>> still on reference on the GIOChannel.
>
> The set_close_on_unref() from gatutil.c is done for ppp_net interface 
> GIOChannel.
> It has nothing to do with the physical layer.
>
> However, we do also:
>     - set_close_on_unref(TRUE) into example/emulator.c
>     - set_close_on_unref(FALSE) into plugins/dun_gw.c
>
> So after the client send ATH0, the connection is removed and emulator 
> should be unregistered and removed but it is not the case.
>
>> In the case the PPP session is ended normally, we call 
>> ppp_ipcp_down_notify() to free the ppp_net interface.
>> Then the physical layer is removed and we got the emulator well 
>> unregistered.
>
> That's why I assume unregistration of the emulator is bound to the way 
> PPP session is ended e.g.
> normally ---> ppp_ipcpdown_notify()
> forced ---> ATH0
>
>> Do you have any idea about what is happening there?
>> Maybe I forgot to do something into dun_ath_cb().

While doing g_at_ppp_unref(), g_at_io_set_disconnect_function() is 
called and clear the io_disconnect function.
Thus, when connection with client is removed, io_disconnect() from 
GAtServer is no more called.

We have to do in dun_ath_cb() this sequence:

g_at_server_suspend(em->server);

g_at_ppp_unref(em->ppp);  /* Clear io_disconnect */
em->ppp = NULL;

g_at_server_resume(em->server); /* Set io_disconnect */


Kind regards,
Guillaume



      reply	other threads:[~2011-05-19 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 10:13 Emulator not unregistered while sending ATH0 Guillaume Zajac
2011-05-19 12:12 ` Guillaume Zajac
2011-05-19 12:58   ` Guillaume Zajac [this message]

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=4DD513E1.7000306@linux.intel.com \
    --to=guillaume.zajac@linux.intel.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.