diff options
author | Guillaume Zajac <guillaume.zajac@linux.intel.com> | 2011-05-20 11:38:14 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-05-24 12:25:07 -0500 |
commit | 7617c492b8d11031892df8c6ae0cdd368a03eca8 (patch) | |
tree | a59dee3057f267f388a8efe476e12b50c02a99f8 /gatchat/gatppp.c | |
parent | 47f5887c2977a0456cf993a356c93016b528b49f (diff) | |
download | ofono-7617c492b8d11031892df8c6ae0cdd368a03eca8.tar.bz2 |
gatppp: Add GAtPPP resume functionality
Diffstat (limited to 'gatchat/gatppp.c')
-rw-r--r-- | gatchat/gatppp.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c index 000d18a9..2608d522 100644 --- a/gatchat/gatppp.c +++ b/gatchat/gatppp.c @@ -79,6 +79,7 @@ struct _GAtPPP { GAtSuspendFunc suspend_func; gpointer suspend_data; int fd; + gboolean suspended; }; void ppp_debug(GAtPPP *ppp, const char *str) @@ -480,6 +481,7 @@ static void ppp_proxy_suspend_net_interface(gpointer user_data) { GAtPPP *ppp = user_data; + ppp->suspended = TRUE; ppp_net_suspend_interface(ppp->net); if (ppp->suspend_func) @@ -507,6 +509,23 @@ void g_at_ppp_shutdown(GAtPPP *ppp) pppcp_signal_close(ppp->lcp); } +void g_at_ppp_resume(GAtPPP *ppp) +{ + if (ppp == NULL) + return; + + if (g_at_hdlc_get_io(ppp->hdlc) == NULL) { + io_disconnect(ppp); + return; + } + + ppp->suspended = FALSE; + g_at_io_set_disconnect_function(g_at_hdlc_get_io(ppp->hdlc), + io_disconnect, ppp); + ppp_net_resume_interface(ppp->net); + g_at_hdlc_resume(ppp->hdlc); +} + void g_at_ppp_ref(GAtPPP *ppp) { g_atomic_int_inc(&ppp->ref_count); |