From 8b339a4754dfc0b7d48c7ca5c14644d7ca178d79 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 22 Nov 2012 06:44:34 -0600 Subject: [PATCH] ifx: Move connman atom to post_sim state --- plugins/ifx.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/plugins/ifx.c b/plugins/ifx.c index ffb9f58..eb30141 100644 --- a/plugins/ifx.c +++ b/plugins/ifx.c @@ -667,6 +667,8 @@ static void ifx_pre_sim(struct ofono_modem *modem) static void ifx_post_sim(struct ofono_modem *modem) { struct ifx_data *data = ofono_modem_get_data(modem); + struct ofono_gprs *gprs; + struct ofono_gprs_context *gc; DBG("%p", modem); @@ -678,14 +680,34 @@ static void ifx_post_sim(struct ofono_modem *modem) ofono_sms_create(modem, OFONO_VENDOR_IFX, "atmodem", data->dlcs[AUX_DLC]); + + gprs = ofono_gprs_create(modem, OFONO_VENDOR_IFX, + "atmodem", data->dlcs[NETREG_DLC]); + if (gprs == NULL) + return; + + if (data->mux_ldisc < 0) { + gc = ofono_gprs_context_create(modem, 0, + "ifxmodem", data->dlcs[GPRS1_DLC]); + if (gc) + ofono_gprs_add_context(gprs, gc); + + gc = ofono_gprs_context_create(modem, 0, + "ifxmodem", data->dlcs[GPRS2_DLC]); + if (gc) + ofono_gprs_add_context(gprs, gc); + + gc = ofono_gprs_context_create(modem, 0, + "ifxmodem", data->dlcs[GPRS3_DLC]); + if (gc) + ofono_gprs_add_context(gprs, gc); + } } static void ifx_post_online(struct ofono_modem *modem) { struct ifx_data *data = ofono_modem_get_data(modem); struct ofono_message_waiting *mw; - struct ofono_gprs *gprs; - struct ofono_gprs_context *gc; DBG("%p", modem); @@ -705,28 +727,6 @@ static void ifx_post_online(struct ofono_modem *modem) mw = ofono_message_waiting_create(modem); if (mw) ofono_message_waiting_register(mw); - - gprs = ofono_gprs_create(modem, OFONO_VENDOR_IFX, - "atmodem", data->dlcs[NETREG_DLC]); - if (gprs == NULL) - return; - - if (data->mux_ldisc < 0) { - gc = ofono_gprs_context_create(modem, 0, - "ifxmodem", data->dlcs[GPRS1_DLC]); - if (gc) - ofono_gprs_add_context(gprs, gc); - - gc = ofono_gprs_context_create(modem, 0, - "ifxmodem", data->dlcs[GPRS2_DLC]); - if (gc) - ofono_gprs_add_context(gprs, gc); - - gc = ofono_gprs_context_create(modem, 0, - "ifxmodem", data->dlcs[GPRS3_DLC]); - if (gc) - ofono_gprs_add_context(gprs, gc); - } } static struct ofono_modem_driver ifx_driver = { -- 2.7.4