summaryrefslogtreecommitdiffstats
path: root/plugins/g1.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-11-18 12:07:14 -0600
committerDenis Kenzior <denkenz@gmail.com>2009-11-18 12:09:42 -0600
commit8c52019c1ac7dddfee0dc9227662506f136fc1f9 (patch)
tree59d5851f74d1b686670eb2fc2475962c93a115c9 /plugins/g1.c
parentf75930f859f1dd3512f7594048085d087062a749 (diff)
downloadofono-8c52019c1ac7dddfee0dc9227662506f136fc1f9.tar.bz2
Fix: modem _disable needs to send the CFUN
For G1 Driver
Diffstat (limited to 'plugins/g1.c')
-rw-r--r--plugins/g1.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/g1.c b/plugins/g1.c
index faccef85..75e6913e 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)