From 9badf5ca73868834f00b1faddfb9ce88354a3c3a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 18 Nov 2009 12:08:47 -0600 Subject: Fix: modem _disable needs to send the CFUN For PalmPre driver --- plugins/palmpre.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'plugins/palmpre.c') diff --git a/plugins/palmpre.c b/plugins/palmpre.c index de2236fa..e6dca08a 100644 --- a/plugins/palmpre.c +++ b/plugins/palmpre.c @@ -138,11 +138,16 @@ static int palmpre_enable(struct ofono_modem *modem) static void cfun_set_off_cb(gboolean ok, GAtResult *result, gpointer user_data) { - GAtChat *chat = user_data; + struct ofono_modem *modem = user_data; + struct palmpre_data *data = ofono_modem_get_data(modem); DBG(""); - g_at_chat_unref(chat); + g_at_chat_unref(data->chat); + data->chat = NULL; + + if (ok) + ofono_modem_set_powered(modem, FALSE); } static int palmpre_disable(struct ofono_modem *modem) @@ -153,13 +158,9 @@ static int palmpre_disable(struct ofono_modem *modem) /* Power modem down */ g_at_chat_send(data->chat, "AT+CFUN=0", NULL, - cfun_set_off_cb, data->chat, NULL); + cfun_set_off_cb, modem, NULL); - ofono_modem_set_powered(modem, FALSE); - - data->chat = NULL; - - return 0; + return -EINPROGRESS; } static void palmpre_pre_sim(struct ofono_modem *modem) -- cgit v1.2.3