Example #1
0
static void mtk_set_fd_mode_cb(struct ril_msg *message, gpointer user_data)
{
	struct cb_data *cbd = user_data;
	struct set_fd_mode *user = cbd->user;
	struct ofono_radio_settings *rs = user->rst;
	struct radio_data *rsd = ofono_radio_settings_get_data(rs);
	ofono_radio_settings_fast_dormancy_set_cb_t cb = cbd->cb;

	if (message->error == RIL_E_SUCCESS) {
		g_ril_print_response_no_args(rsd->ril, message);
		ril_set_fast_dormancy(rs, user->on, cb, cbd->data);
	} else {
		CALLBACK_WITH_FAILURE(cb, cbd->data);
	}

	g_free(user);
}
Example #2
0
static int ril_radio_settings_probe(struct ofono_radio_settings *rs,
					unsigned int vendor, void *user)
{
	struct ril_radio_settings_driver_data *rs_init_data = user;
	struct radio_data *rsd = g_try_new0(struct radio_data, 1);

	if (rsd == NULL) {
		ofono_error("%s: cannot allocate memory", __func__);
		return -ENOMEM;
	}

	rsd->virt_tbl = &driver;
	rsd->ril = g_ril_clone(rs_init_data->gril);
	rsd->modem = rs_init_data->modem;

	ofono_radio_settings_set_data(rs, rsd);

	ril_set_fast_dormancy(rs, FALSE, ril_delayed_register, rs);

	return 0;
}
Example #3
0
static void mtk_set_fd_mode_cb(struct ril_msg *message, gpointer user_data)
{
	struct cb_data *cbd = user_data;
	struct set_fd_mode *user = cbd->user;
	struct ofono_radio_settings *rs = user->rst;
	struct radio_data *rsd = ofono_radio_settings_get_data(rs);
	ofono_radio_settings_fast_dormancy_set_cb_t cb = cbd->cb;

	if (message->error == RIL_E_SUCCESS ||
			message->error == RIL_E_RADIO_NOT_AVAILABLE) {

		if (message->error == RIL_E_RADIO_NOT_AVAILABLE)
			ofono_warn("Could not set fast dormancy "
					"as radio is not available");

		g_ril_print_response_no_args(rsd->ril, message);
		ril_set_fast_dormancy(rs, user->on, cb, cbd->data);
	} else {
		CALLBACK_WITH_FAILURE(cb, cbd->data);
	}

	g_free(user);
}