diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-11-18 12:08:47 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-11-18 12:09:43 -0600 |
commit | 9badf5ca73868834f00b1faddfb9ce88354a3c3a (patch) | |
tree | 70f028a6d2a7855ebd3372eec89b89d0afbdd231 /plugins/palmpre.c | |
parent | d7613a047827e7a8d9dc46e5c1024a9705e164f8 (diff) | |
download | ofono-9badf5ca73868834f00b1faddfb9ce88354a3c3a.tar.bz2 |
Fix: modem _disable needs to send the CFUN
For PalmPre driver
Diffstat (limited to 'plugins/palmpre.c')
-rw-r--r-- | plugins/palmpre.c | 17 |
1 files changed, 9 insertions, 8 deletions
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) |