Ejemplo n.º 1
0
static int ril_gprs_probe(struct ofono_gprs *gprs,
				unsigned int vendor, void *data)
{
	GRil *ril = data;
	struct gprs_data *gd;

	gd = g_try_new0(struct gprs_data, 1);
	if (gd == NULL)
		return -ENOMEM;

	gd->ril = g_ril_clone(ril);
	gd->ofono_attached = FALSE;
	gd->max_cids = 0;
	gd->rild_status = -1;
	gd->true_status = -1;
	gd->notified = FALSE;
	gd->registerid = -1;
	gd->timer_id = 0;
	gd->fake_timer_id = 0;
	gd->fake_cbd = NULL;

	registered = FALSE;

	ofono_gprs_set_data(gprs, gd);

	ril_gprs_registration_status(gprs, NULL, NULL);

	return 0;
}
Ejemplo n.º 2
0
Archivo: gprs.c Proyecto: morphis/ofono
static gboolean ril_get_status_retry(gpointer user_data)
{
	struct ofono_gprs *gprs = user_data;
	struct ril_gprs_data *gd = ofono_gprs_get_data(gprs);

	gd->status_retry_cb_id = 0;

	ril_gprs_registration_status(gprs, NULL, NULL);

	return FALSE;
}
Ejemplo n.º 3
0
Archivo: gprs.c Proyecto: saukko/ofono
static void ril_gprs_state_change(struct ril_msg *message, gpointer user_data)
{
	struct ofono_gprs *gprs = user_data;

	g_assert(message->req == RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED);

	/* We need to notify core always to cover situations when
	 * connection drops temporarily for example when user is
	 * taking CS voice call from LTE or changing technology
	 * preference */
	ril_gprs_registration_status(gprs, NULL, NULL);
}
Ejemplo n.º 4
0
static void ril_gprs_state_change(struct ril_msg *message, gpointer user_data)
{
	struct ofono_gprs *gprs = user_data;

	if (message->req != RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED) {
		ofono_error("ril_gprs_state_change: invalid message received %d",
				message->req);
		return;
	}

	ril_gprs_registration_status(gprs, NULL, NULL);
}
Ejemplo n.º 5
0
static void drop_data_call_cb(struct ril_msg *message, gpointer user_data)
{
	struct ofono_gprs *gprs = user_data;
	struct ril_gprs_data *gd = ofono_gprs_get_data(gprs);

	if (message->error == RIL_E_SUCCESS)
		g_ril_print_response_no_args(gd->ril, message);
	else
		ofono_error("%s: RIL error %s", __func__,
				ril_error_to_string(message->error));

	if (--(gd->pending_deact_req) == 0)
		ril_gprs_registration_status(gprs, NULL, NULL);
}
Ejemplo n.º 6
0
static void ril_gprs_state_change(struct ril_msg *message, gpointer user_data)
{
	struct ofono_gprs *gprs = user_data;
	struct ril_gprs_data *gd = ofono_gprs_get_data(gprs);

	g_ril_print_unsol_no_args(gd->ril, message);

	/*
	 * We just want to track network data status if ofono
	 * itself is attached, so we avoid unnecessary data state requests.
	 */
	if (gd->ofono_attached == TRUE)
		ril_gprs_registration_status(gprs, NULL, NULL);
}
Ejemplo n.º 7
0
static int ril_gprs_probe(struct ofono_gprs *gprs,
				unsigned int vendor, void *data)
{
	GRil *ril = data;
	struct gprs_data *gd;

        DBG("");

	gd = g_try_new0(struct gprs_data, 1);
	if (gd == NULL)
		return -ENOMEM;

	gd->ril = g_ril_clone(ril);
	gd->max_cids = 0;
	gd->status = -1;

	ofono_gprs_set_data(gprs, gd);

	ril_gprs_registration_status(gprs, NULL, NULL);

	return 0;
}
Ejemplo n.º 8
0
static void get_active_data_calls_cb(struct ril_msg *message,
					gpointer user_data)
{
	struct ofono_gprs *gprs = user_data;
	struct ril_gprs_data *gd = ofono_gprs_get_data(gprs);
	struct ril_data_call_list *call_list = NULL;
	GSList *iterator;
	struct ril_data_call *call;

	if (message->error != RIL_E_SUCCESS) {
		ofono_error("%s: RIL error %s", __func__,
				ril_error_to_string(message->error));
		goto end;
	}

	/* reply can be NULL when there are no existing data calls */
	call_list = g_ril_unsol_parse_data_call_list(gd->ril, message);
	if (call_list == NULL)
		goto end;

	/*
	 * We disconnect from previous calls here, which might be needed
	 * because of a previous ofono abort, as some rild implementations do
	 * not disconnect the calls even after the ril socket is closed.
	 */
	for (iterator = call_list->calls; iterator; iterator = iterator->next) {
		call = iterator->data;
		DBG("Standing data call with cid %d", call->cid);
		if (drop_data_call(gprs, call->cid) == 0)
			++(gd->pending_deact_req);
	}

	g_ril_unsol_free_data_call_list(call_list);

end:
	if (gd->pending_deact_req == 0)
		ril_gprs_registration_status(gprs, NULL, NULL);
}