mirror of git://git.sysmocom.de/ofono
rilmodem: Don't expose private structures
This commit is contained in:
parent
6fbb1e18f8
commit
55cedbf109
|
@ -42,7 +42,6 @@
|
||||||
|
|
||||||
#include "grilunsol.h"
|
#include "grilunsol.h"
|
||||||
|
|
||||||
#include "gprs.h"
|
|
||||||
#include "rilmodem.h"
|
#include "rilmodem.h"
|
||||||
|
|
||||||
#define NUM_DEACTIVATION_RETRIES 4
|
#define NUM_DEACTIVATION_RETRIES 4
|
||||||
|
@ -243,10 +242,6 @@ static void ril_gprs_context_activate_primary(struct ofono_gprs_context *gc,
|
||||||
{
|
{
|
||||||
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
|
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
|
||||||
struct ofono_modem *modem = ofono_gprs_context_get_modem(gc);
|
struct ofono_modem *modem = ofono_gprs_context_get_modem(gc);
|
||||||
struct ofono_atom *gprs_atom =
|
|
||||||
__ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_GPRS);
|
|
||||||
struct ofono_gprs *gprs = NULL;
|
|
||||||
struct ril_gprs_data *gd = NULL;
|
|
||||||
struct cb_data *cbd = cb_data_new(cb, data, gc);
|
struct cb_data *cbd = cb_data_new(cb, data, gc);
|
||||||
struct parcel rilp;
|
struct parcel rilp;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
@ -255,15 +250,13 @@ static void ril_gprs_context_activate_primary(struct ofono_gprs_context *gc,
|
||||||
const char *profile;
|
const char *profile;
|
||||||
int auth_type;
|
int auth_type;
|
||||||
|
|
||||||
gprs = __ofono_atom_get_data(gprs_atom);
|
tech = ofono_modem_get_integer(modem, "RilDataRadioTechnology");
|
||||||
gd = ofono_gprs_get_data(gprs);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 0: CDMA 1: GSM/UMTS, 2...
|
* 0: CDMA 1: GSM/UMTS, 2...
|
||||||
* anything 2+ is a RadioTechnology value +2
|
* anything 2+ is a RadioTechnology value +2
|
||||||
*/
|
*/
|
||||||
DBG("*gc: %p activating cid: %d; curr_tech: %d", gc, ctx->cid,
|
DBG("*gc: %p activating cid: %d; curr_tech: %d", gc, ctx->cid, tech);
|
||||||
gd->tech);
|
|
||||||
|
|
||||||
parcel_init(&rilp);
|
parcel_init(&rilp);
|
||||||
|
|
||||||
|
@ -272,13 +265,12 @@ static void ril_gprs_context_activate_primary(struct ofono_gprs_context *gc,
|
||||||
|
|
||||||
parcel_w_int32(&rilp, num_param);
|
parcel_w_int32(&rilp, num_param);
|
||||||
|
|
||||||
if (gd->tech == RADIO_TECH_UNKNOWN) {
|
if (tech == RADIO_TECH_UNKNOWN) {
|
||||||
ofono_error("%s: radio tech for apn: %s UNKNOWN!", __func__,
|
ofono_error("%s: radio tech for apn: %s UNKNOWN!", __func__,
|
||||||
gcd->apn);
|
gcd->apn);
|
||||||
tech = 1;
|
tech = 1;
|
||||||
} else if (gd->tech <= RADIO_TECH_GSM) {
|
|
||||||
tech = gd->tech + 2;
|
|
||||||
} else
|
} else
|
||||||
|
tech = tech + 2;
|
||||||
|
|
||||||
sprintf(buf, "%d", tech);
|
sprintf(buf, "%d", tech);
|
||||||
parcel_w_string(&rilp, buf);
|
parcel_w_string(&rilp, buf);
|
||||||
|
|
|
@ -126,6 +126,7 @@ static void ril_data_reg_cb(struct ril_msg *message, gpointer user_data)
|
||||||
ofono_gprs_status_cb_t cb = cbd->cb;
|
ofono_gprs_status_cb_t cb = cbd->cb;
|
||||||
struct ofono_gprs *gprs = cbd->user;
|
struct ofono_gprs *gprs = cbd->user;
|
||||||
struct ril_gprs_data *gd = ofono_gprs_get_data(gprs);
|
struct ril_gprs_data *gd = ofono_gprs_get_data(gprs);
|
||||||
|
struct ofono_modem *modem;
|
||||||
struct parcel rilp;
|
struct parcel rilp;
|
||||||
int num_str;
|
int num_str;
|
||||||
char **strv;
|
char **strv;
|
||||||
|
@ -256,11 +257,9 @@ static void ril_data_reg_cb(struct ril_msg *message, gpointer user_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gd->tech != tech) {
|
modem = ofono_gprs_get_modem(gprs);
|
||||||
gd->tech = tech;
|
ofono_modem_set_integer(modem, "RilDataRadioTechnology", tech);
|
||||||
|
ofono_gprs_bearer_notify(gprs, ril_tech_to_bearer_tech(tech));
|
||||||
ofono_gprs_bearer_notify(gprs, ril_tech_to_bearer_tech(tech));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cb)
|
if (cb)
|
||||||
CALLBACK_WITH_SUCCESS(cb, status, cbd->data);
|
CALLBACK_WITH_SUCCESS(cb, status, cbd->data);
|
||||||
|
@ -474,7 +473,6 @@ static int ril_gprs_probe(struct ofono_gprs *gprs, unsigned int vendor,
|
||||||
gd->ril = g_ril_clone(ril);
|
gd->ril = g_ril_clone(ril);
|
||||||
gd->ofono_attached = FALSE;
|
gd->ofono_attached = FALSE;
|
||||||
gd->rild_status = -1;
|
gd->rild_status = -1;
|
||||||
gd->tech = RADIO_TECH_UNKNOWN;
|
|
||||||
|
|
||||||
ofono_gprs_set_data(gprs, gd);
|
ofono_gprs_set_data(gprs, gd);
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,5 @@ struct ril_gprs_data {
|
||||||
struct ofono_modem *modem;
|
struct ofono_modem *modem;
|
||||||
gboolean ofono_attached;
|
gboolean ofono_attached;
|
||||||
int rild_status;
|
int rild_status;
|
||||||
int tech;
|
|
||||||
int pending_deact_req;
|
int pending_deact_req;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue