* [PATCH 05/18] gatppp: add g_at_ppp_set_suspend_function() definition
@ 2011-03-25 15:25 Guillaume Zajac
2011-03-30 20:54 ` Denis Kenzior
0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Zajac @ 2011-03-25 15:25 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 691 bytes --]
---
gatchat/gatppp.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index 993b5ea..9df6b8e 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -467,6 +467,14 @@ void g_at_ppp_set_debug(GAtPPP *ppp, GAtDebugFunc func, gpointer user_data)
ppp->debug_data = user_data;
}
+void g_at_ppp_set_suspend_function(GAtPPP *ppp, GAtSuspendFunc func, gpointer user_data)
+{
+ if (ppp == NULL)
+ return;
+
+ g_at_hdlc_set_suspend_function(ppp->hdlc, func, user_data);
+}
+
void g_at_ppp_shutdown(GAtPPP *ppp)
{
if (ppp->phase == PPP_PHASE_DEAD || ppp->phase == PPP_PHASE_TERMINATION)
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 05/18] gatppp: add g_at_ppp_set_suspend_function() definition
2011-03-25 15:25 [PATCH 05/18] gatppp: add g_at_ppp_set_suspend_function() definition Guillaume Zajac
@ 2011-03-30 20:54 ` Denis Kenzior
2011-03-31 9:04 ` Guillaume Zajac
0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2011-03-30 20:54 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 980 bytes --]
Hi Guillaume,
On 03/25/2011 10:25 AM, Guillaume Zajac wrote:
> ---
> gatchat/gatppp.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
> index 993b5ea..9df6b8e 100644
> --- a/gatchat/gatppp.c
> +++ b/gatchat/gatppp.c
> @@ -467,6 +467,14 @@ void g_at_ppp_set_debug(GAtPPP *ppp, GAtDebugFunc func, gpointer user_data)
> ppp->debug_data = user_data;
> }
>
> +void g_at_ppp_set_suspend_function(GAtPPP *ppp, GAtSuspendFunc func, gpointer user_data)
> +{
> + if (ppp == NULL)
> + return;
> +
> + g_at_hdlc_set_suspend_function(ppp->hdlc, func, user_data);
> +}
> +
This is really not enough, you must also shut down the read watch on the
TUN device, so that we don't try to forward packets from TUN to HDLC
while we're suspended.
> void g_at_ppp_shutdown(GAtPPP *ppp)
> {
> if (ppp->phase == PPP_PHASE_DEAD || ppp->phase == PPP_PHASE_TERMINATION)
Regards,
-Denis
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 05/18] gatppp: add g_at_ppp_set_suspend_function() definition
2011-03-30 20:54 ` Denis Kenzior
@ 2011-03-31 9:04 ` Guillaume Zajac
0 siblings, 0 replies; 3+ messages in thread
From: Guillaume Zajac @ 2011-03-31 9:04 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]
Hi Denis,
On 30/03/2011 22:54, Denis Kenzior wrote:
> Hi Guillaume,
>
> On 03/25/2011 10:25 AM, Guillaume Zajac wrote:
>> ---
>> gatchat/gatppp.c | 8 ++++++++
>> 1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
>> index 993b5ea..9df6b8e 100644
>> --- a/gatchat/gatppp.c
>> +++ b/gatchat/gatppp.c
>> @@ -467,6 +467,14 @@ void g_at_ppp_set_debug(GAtPPP *ppp, GAtDebugFunc func, gpointer user_data)
>> ppp->debug_data = user_data;
>> }
>>
>> +void g_at_ppp_set_suspend_function(GAtPPP *ppp, GAtSuspendFunc func, gpointer user_data)
>> +{
>> + if (ppp == NULL)
>> + return;
>> +
>> + g_at_hdlc_set_suspend_function(ppp->hdlc, func, user_data);
>> +}
>> +
> This is really not enough, you must also shut down the read watch on the
> TUN device, so that we don't try to forward packets from TUN to HDLC
> while we're suspended.
>
I will add into g_at_ppp_suspend():
-->ppp_net_suspend() to shut down read watch
and into g_at_ppp_resume():
-->ppp_net_resume() to resume read watch
Kind regards,
Guillaume
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-31 9:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-25 15:25 [PATCH 05/18] gatppp: add g_at_ppp_set_suspend_function() definition Guillaume Zajac
2011-03-30 20:54 ` Denis Kenzior
2011-03-31 9:04 ` Guillaume Zajac
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.