From 8c52019c1ac7dddfee0dc9227662506f136fc1f9 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 18 Nov 2009 12:07:14 -0600 Subject: [PATCH] Fix: modem _disable needs to send the CFUN For G1 Driver --- plugins/g1.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/g1.c b/plugins/g1.c index faccef8..75e6913 100644 --- a/plugins/g1.c +++ b/plugins/g1.c @@ -121,9 +121,13 @@ static int g1_enable(struct ofono_modem *modem) static void cfun_set_off_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct ofono_modem *modem = user_data; + GAtChat *chat = ofono_modem_get_data(modem); DBG(""); + g_at_chat_unref(chat); + ofono_modem_set_data(modem, NULL); + if (ok) ofono_modem_set_powered(modem, FALSE); } @@ -137,10 +141,7 @@ static int g1_disable(struct ofono_modem *modem) /* power down modem */ g_at_chat_send(chat, "AT+CFUN=0", NULL, cfun_set_off_cb, modem, NULL); - g_at_chat_unref(chat); - ofono_modem_set_data(modem, NULL); - - return 0; + return -EINPROGRESS; } static void g1_pre_sim(struct ofono_modem *modem) -- 2.7.4