summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaiwen Zhang <caiwen.zhang@intel.com>2016-05-12 13:51:03 +0800
committerDenis Kenzior <denkenz@gmail.com>2016-05-13 20:54:56 -0500
commit6c328f8529a3b91cc09fcfcce3b6867174a1d888 (patch)
tree2d39b69564fc3145e6e2fc08ef2cf9b2a84c91fa
parent979e8e21b9c3b9a0f5d07f21d2840d8ac1c700a1 (diff)
downloadofono-6c328f8529a3b91cc09fcfcce3b6867174a1d888.tar.gz
plugins/ril: complete modem power off process
-rw-r--r--plugins/ril.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/plugins/ril.c b/plugins/ril.c
index 2298bb61..2ea3fb5c 100644
--- a/plugins/ril.c
+++ b/plugins/ril.c
@@ -409,15 +409,30 @@ int ril_enable(struct ofono_modem *modem)
return -EINPROGRESS;
}
+static void power_off_cb(struct ril_msg *message, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ struct ril_data *rd = cbd->user;
+ struct ofono_modem *modem = cbd->data;
+
+ if (rd) {
+ g_ril_unref(rd->ril);
+ rd->ril = NULL;
+ }
+
+ ofono_modem_set_powered(modem, FALSE);
+}
+
int ril_disable(struct ofono_modem *modem)
{
struct ril_data *rd = ofono_modem_get_data(modem);
+ struct cb_data *cbd = cb_data_new(NULL, modem, rd);
DBG("%p", modem);
- ril_send_power(rd, FALSE, NULL, NULL);
+ ril_send_power(rd, FALSE, power_off_cb, cbd);
- return 0;
+ return -EINPROGRESS;
}
static struct ofono_modem_driver ril_driver = {