Compare commits

...

10 Commits

Author SHA1 Message Date
Marcel Holtmann
52f487c3d6 Release 1.33 2021-09-15 13:21:27 +02:00
Slava Monich
121448e378 simfs: Fix reads beyond the first block 2021-07-30 11:07:19 -05:00
Sergey Matyukevich
b06759215d gemalto: radio-settings: cleanup
Enum ofono_radio_access_mode has been replaced by unsigned int.
This change allows to move handling of all the modes into
'switch' in the function gemalto_set_rat_mode.
2021-07-27 09:30:37 -05:00
Sergey Matyukevich
02e58cc8a9 plugins: gemalto: move ussd atom to post_online
Gemalto modem does not allow to enable Supplementary Service
during post_sim stage. So move ussd atom to post_online stage.
2021-07-15 13:12:20 -05:00
Sergey Matyukevich
8b3d0e23ee plugins: gemalto: add radio-settings atom
Instantiate Gemalto radio-settings atom in post_sim.
2021-07-15 13:12:13 -05:00
Sergey Matyukevich
8e0871c284 gemalto: add radio-settings driver
Add support for Gemalto specific radio settings.
2021-07-15 13:09:32 -05:00
Denis Kenzior
4adcc7f965 README: Mention the new OFTC irc channel 2021-06-15 09:24:07 -05:00
Denis Kenzior
1d86dbc6c8 radio-settings: Do not use enum ofono_access_mode
Originally the enum was only meant to signify a single radio access mode
preference, but over time its meaning was overloaded to be a bitfield
with multiple preferences.  Switch away from using an enum value to
using an unsigned int to make it clearer that the value is a bitfield.
2021-06-01 11:20:37 -05:00
Sean Nyekjaer
f10b870c25 qmimodem: Add handling of dual mode technology preference
Handled dual mode technology preference "lte,gsm" for Quectel BG96.
Quectel BG96 doesn't support ANY mode.
2021-06-01 10:52:48 -05:00
Sean Nyekjaer
7ce4b77138 radio-settings: Add handling of dual mode technology preference
Allow setting of "lte,gsm" mode,
for modems that doesn't support ANY mode.
2021-06-01 10:52:48 -05:00
22 changed files with 337 additions and 58 deletions

View File

@@ -1,3 +1,8 @@
ver 1.33:
Fix issue with filling unused part of AID with FFs.
Fix issue with reads beyond the first block of SIM filesystem.
Fix issue with parsing auth response according to TS 31.102.
ver 1.32:
Fix issue with handling of IMS private identity validation.
Fix issue with handling of SIM EF structure bit processing.

View File

@@ -487,6 +487,7 @@ builtin_sources += drivers/atmodem/atutil.h \
drivers/gemaltomodem/location-reporting.c \
drivers/gemaltomodem/voicecall.c \
drivers/gemaltomodem/gprs-context.c \
drivers/gemaltomodem/radio-settings.c \
drivers/gemaltomodem/netmon.c
builtin_modules += xmm7modem

3
README
View File

@@ -64,5 +64,8 @@ Information
Mailing list:
ofono@ofono.org
IRC:
irc://irc.oftc.net/#ofono
For additional information about the project visit oFono web site:
http://www.ofono.org

View File

@@ -1,5 +1,5 @@
AC_PREREQ(2.60)
AC_INIT(ofono, 1.32)
AC_INIT(ofono, 1.33)
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
AC_CONFIG_HEADERS(config.h)

View File

@@ -36,6 +36,7 @@
static int gemaltomodem_init(void)
{
gemalto_location_reporting_init();
gemalto_radio_settings_init();
gemalto_gprs_context_init();
gemalto_voicecall_init();
gemalto_netmon_init();
@@ -46,6 +47,7 @@ static int gemaltomodem_init(void)
static void gemaltomodem_exit(void)
{
gemalto_location_reporting_exit();
gemalto_radio_settings_exit();
gemalto_gprs_context_exit();
gemalto_voicecall_exit();
gemalto_netmon_exit();

View File

@@ -33,3 +33,6 @@ extern void gemalto_gprs_context_exit();
extern void gemalto_netmon_init(void);
extern void gemalto_netmon_exit(void);
extern void gemalto_radio_settings_init(void);
extern void gemalto_radio_settings_exit(void);

View File

@@ -0,0 +1,264 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Intel Corporation. All rights reserved.
* Copyright (C) 2021 Sergey Matyukevich. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <glib.h>
#include <ofono/log.h>
#include <ofono/modem.h>
#include <ofono/radio-settings.h>
#include "gatchat.h"
#include "gatresult.h"
#include "gemaltomodem.h"
static const char *none_prefix[] = { NULL };
static const char *sxrat_prefix[] = { "^SXRAT:", NULL };
struct radio_settings_data {
GAtChat *chat;
};
static void sxrat_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
unsigned int mode;
struct ofono_error error;
int value, pref1, pref2;
GAtResultIter iter;
DBG("ok %d", ok);
decode_at_error(&error, g_at_result_final_response(result));
if (!ok) {
cb(&error, -1, cbd->data);
return;
}
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "^SXRAT:"))
goto error;
if (!g_at_result_iter_next_number(&iter, &value))
goto error;
g_at_result_iter_next_number_default(&iter, -1, &pref1);
g_at_result_iter_next_number_default(&iter, -1, &pref2);
DBG("mode %d pref1 %d pref2 %d", value, pref1, pref2);
switch (value) {
case 0:
mode = OFONO_RADIO_ACCESS_MODE_GSM;
break;
case 1:
mode = OFONO_RADIO_ACCESS_MODE_GSM |
OFONO_RADIO_ACCESS_MODE_UMTS;
break;
case 2:
mode = OFONO_RADIO_ACCESS_MODE_UMTS;
break;
case 3:
mode = OFONO_RADIO_ACCESS_MODE_LTE;
break;
case 4:
mode = OFONO_RADIO_ACCESS_MODE_UMTS |
OFONO_RADIO_ACCESS_MODE_LTE;
break;
case 5:
mode = OFONO_RADIO_ACCESS_MODE_GSM |
OFONO_RADIO_ACCESS_MODE_LTE;
break;
case 6:
mode = OFONO_RADIO_ACCESS_MODE_ANY;
break;
default:
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
return;
}
cb(&error, mode, cbd->data);
return;
error:
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
}
static void gemalto_query_rat_mode(struct ofono_radio_settings *rs,
ofono_radio_settings_rat_mode_query_cb_t cb,
void *data)
{
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
struct cb_data *cbd = cb_data_new(cb, data);
DBG("");
if (g_at_chat_send(rsd->chat, "AT^SXRAT?", sxrat_prefix,
sxrat_query_cb, cbd, g_free) == 0) {
CALLBACK_WITH_FAILURE(cb, -1, data);
g_free(cbd);
}
}
static void sxrat_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_set_cb_t cb = cbd->cb;
struct ofono_error error;
DBG("ok %d", ok);
decode_at_error(&error, g_at_result_final_response(result));
cb(&error, cbd->data);
}
static void gemalto_set_rat_mode(struct ofono_radio_settings *rs,
unsigned int m,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
struct cb_data *cbd = cb_data_new(cb, data);
int val= 6, p1 = 3, p2 = 2;
char buf[20];
DBG("mode %d", m);
switch (m) {
case OFONO_RADIO_ACCESS_MODE_ANY:
val = 6;
p1 = 3;
p2 = 2;
break;
case OFONO_RADIO_ACCESS_MODE_GSM:
val = 0;
break;
case OFONO_RADIO_ACCESS_MODE_UMTS:
val = 2;
break;
case OFONO_RADIO_ACCESS_MODE_LTE:
val = 3;
break;
case OFONO_RADIO_ACCESS_MODE_UMTS|OFONO_RADIO_ACCESS_MODE_GSM:
val = 1;
p1 = 2;
break;
case OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS:
val = 4;
p1 = 3;
break;
case OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM:
val = 5;
p1 = 3;
break;
}
if (val == 6)
snprintf(buf, sizeof(buf), "AT^SXRAT=%u,%u,%u", val, p1, p2);
else if (val == 1 || val == 4 || val == 5)
snprintf(buf, sizeof(buf), "AT^SXRAT=%u,%u", val, p1);
else
snprintf(buf, sizeof(buf), "AT^SXRAT=%u", val);
if (g_at_chat_send(rsd->chat, buf, none_prefix,
sxrat_modify_cb, cbd, g_free) > 0)
return;
CALLBACK_WITH_FAILURE(cb, data);
g_free(cbd);
}
static void sxrat_support_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_radio_settings *rs = user_data;
DBG("ok %d", ok);
if (!ok) {
ofono_radio_settings_remove(rs);
return;
}
ofono_radio_settings_register(rs);
}
static int gemalto_radio_settings_probe(struct ofono_radio_settings *rs,
unsigned int vendor, void *data)
{
GAtChat *chat = data;
struct radio_settings_data *rsd;
DBG("");
rsd = g_new0(struct radio_settings_data, 1);
rsd->chat = g_at_chat_clone(chat);
ofono_radio_settings_set_data(rs, rsd);
g_at_chat_send(rsd->chat, "AT^SXRAT=?", sxrat_prefix,
sxrat_support_cb, rs, NULL);
return 0;
}
static void gemalto_radio_settings_remove(struct ofono_radio_settings *rs)
{
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
DBG("");
ofono_radio_settings_set_data(rs, NULL);
g_at_chat_unref(rsd->chat);
g_free(rsd);
}
static const struct ofono_radio_settings_driver driver = {
.name = "gemaltomodem",
.probe = gemalto_radio_settings_probe,
.remove = gemalto_radio_settings_remove,
.query_rat_mode = gemalto_query_rat_mode,
.set_rat_mode = gemalto_set_rat_mode
};
void gemalto_radio_settings_init(void)
{
ofono_radio_settings_driver_register(&driver);
}
void gemalto_radio_settings_exit(void)
{
ofono_radio_settings_driver_unregister(&driver);
}

View File

@@ -50,7 +50,7 @@ static void opsys_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
int value;
@@ -120,7 +120,7 @@ static void opsys_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
}
static void hso_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -134,7 +134,7 @@ static void syscfg_query_mode_cb(gboolean ok, GAtResult *result,
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
int value;
@@ -182,7 +182,7 @@ static void syscfgex_query_mode_cb(gboolean ok, GAtResult *result,
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
const char *acqorder;
@@ -262,7 +262,7 @@ static void syscfgxx_modify_mode_cb(gboolean ok, GAtResult *result,
}
static void syscfg_set_rat_mode(struct radio_settings_data *rsd,
enum ofono_radio_access_mode mode,
unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{
@@ -302,7 +302,7 @@ error:
}
static void syscfgex_set_rat_mode(struct radio_settings_data *rsd,
enum ofono_radio_access_mode mode,
unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{
@@ -344,7 +344,7 @@ static void syscfgex_set_rat_mode(struct radio_settings_data *rsd,
}
static void huawei_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -51,7 +51,7 @@ static void ipsys_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
int value;
@@ -121,7 +121,7 @@ static void ipsys_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
}
static void icera_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -50,7 +50,7 @@ static void xrat_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
int value, preferred;
@@ -120,8 +120,7 @@ static void xrat_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
cb(&error, cbd->data);
}
static void ifx_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
static void ifx_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -52,7 +52,7 @@ struct radio_data {
uint16_t quick_release:1;
};
static enum ofono_radio_access_mode isi_mode_to_ofono_mode(guint8 mode)
static unsigned int isi_mode_to_ofono_mode(guint8 mode)
{
switch (mode) {
case GSS_DUAL_RAT:
@@ -66,7 +66,7 @@ static enum ofono_radio_access_mode isi_mode_to_ofono_mode(guint8 mode)
}
}
static int ofono_mode_to_isi_mode(enum ofono_radio_access_mode mode)
static int ofono_mode_to_isi_mode(unsigned int mode)
{
switch (mode) {
case OFONO_RADIO_ACCESS_MODE_ANY:
@@ -184,8 +184,7 @@ error:
return;
}
static void isi_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
static void isi_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -50,7 +50,7 @@ static void nwrat_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
int value;
@@ -117,8 +117,7 @@ static void nwrat_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
cb(&error, cbd->data);
}
static void nw_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
static void nw_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -45,7 +45,7 @@ static void get_system_selection_pref_cb(struct qmi_result *result,
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode = OFONO_RADIO_ACCESS_MODE_ANY;
unsigned int mode = OFONO_RADIO_ACCESS_MODE_ANY;
uint16_t pref;
DBG("");
@@ -68,6 +68,9 @@ static void get_system_selection_pref_cb(struct qmi_result *result,
case QMI_NAS_RAT_MODE_PREF_LTE:
mode = OFONO_RADIO_ACCESS_MODE_LTE;
break;
case QMI_NAS_RAT_MODE_PREF_GSM|QMI_NAS_RAT_MODE_PREF_LTE:
mode = OFONO_RADIO_ACCESS_MODE_GSM|OFONO_RADIO_ACCESS_MODE_LTE;
break;
}
CALLBACK_WITH_SUCCESS(cb, mode, cbd->data);
@@ -106,8 +109,7 @@ static void set_system_selection_pref_cb(struct qmi_result *result,
CALLBACK_WITH_SUCCESS(cb, cbd->data);
}
static void qmi_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
static void qmi_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *user_data)
{
@@ -131,6 +133,9 @@ static void qmi_set_rat_mode(struct ofono_radio_settings *rs,
case OFONO_RADIO_ACCESS_MODE_LTE:
pref = QMI_NAS_RAT_MODE_PREF_LTE;
break;
case OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM:
pref = QMI_NAS_RAT_MODE_PREF_LTE|QMI_NAS_RAT_MODE_PREF_GSM;
break;
}
param = qmi_param_new();

View File

@@ -102,8 +102,7 @@ static void ril_set_rat_cb(struct ril_msg *message, gpointer user_data)
}
}
static void ril_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
static void ril_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -56,7 +56,7 @@ enum ste_radio_mode {
};
static gboolean ste_mode_to_ofono_mode(enum ste_radio_mode stemode,
enum ofono_radio_access_mode *mode)
unsigned int *mode)
{
switch (stemode) {
case STE_RADIO_ON:
@@ -76,7 +76,7 @@ static gboolean ste_mode_to_ofono_mode(enum ste_radio_mode stemode,
return FALSE;
}
static gboolean ofono_mode_to_ste_mode(enum ofono_radio_access_mode mode,
static gboolean ofono_mode_to_ste_mode(unsigned int mode,
enum ste_radio_mode *stemode)
{
switch (mode) {
@@ -100,7 +100,7 @@ static void rat_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
int value;
@@ -161,8 +161,7 @@ static void rat_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
CALLBACK_WITH_SUCCESS(cb, cbd->data);
}
static void ste_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
static void ste_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -50,7 +50,7 @@ static void xact_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
int value, preferred;
@@ -133,8 +133,7 @@ static void xact_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
cb(&error, cbd->data);
}
static void xmm_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
static void xmm_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -50,7 +50,7 @@ static void zsnt_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
unsigned int mode;
struct ofono_error error;
GAtResultIter iter;
int value;
@@ -117,8 +117,7 @@ static void zsnt_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
cb(&error, cbd->data);
}
static void zte_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
static void zte_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{

View File

@@ -60,8 +60,7 @@ typedef void (*ofono_radio_settings_rat_mode_set_cb_t)(
void *data);
typedef void (*ofono_radio_settings_rat_mode_query_cb_t)(
const struct ofono_error *error,
enum ofono_radio_access_mode mode,
void *data);
int mode, void *data);
typedef void (*ofono_radio_settings_band_set_cb_t)(
const struct ofono_error *error,
@@ -93,8 +92,7 @@ struct ofono_radio_settings_driver {
void (*query_rat_mode)(struct ofono_radio_settings *rs,
ofono_radio_settings_rat_mode_query_cb_t cb,
void *data);
void (*set_rat_mode)(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
void (*set_rat_mode)(struct ofono_radio_settings *rs, unsigned int mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data);
void (*query_band)(struct ofono_radio_settings *rs,

View File

@@ -49,6 +49,7 @@
#include <ofono/gprs-context.h>
#include <ofono/location-reporting.h>
#include <ofono/netmon.h>
#include <ofono/radio-settings.h>
#include <drivers/atmodem/atutil.h>
#include <drivers/atmodem/vendor.h>
@@ -597,6 +598,7 @@ static void gemalto_post_sim(struct ofono_modem *modem)
ofono_phonebook_create(modem, 0, "atmodem", data->app);
ofono_sms_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", data->app);
ofono_radio_settings_create(modem, 0, "gemaltomodem", data->app);
gprs = ofono_gprs_create(modem, 0, "atmodem", data->app);
@@ -612,8 +614,6 @@ static void gemalto_post_sim(struct ofono_modem *modem)
if (gprs && gc)
ofono_gprs_add_context(gprs, gc);
ofono_ussd_create(modem, 0, "atmodem", data->app);
if (!g_strcmp0(model, GEMALTO_MODEL_ALS3_PLS8x) ||
!g_strcmp0(model, GEMALTO_MODEL_ELS81x))
ofono_lte_create(modem, OFONO_VENDOR_GEMALTO,
@@ -637,6 +637,8 @@ static void gemalto_post_online(struct ofono_modem *modem)
ofono_call_meter_create(modem, 0, "atmodem", data->app);
ofono_call_barring_create(modem, 0, "atmodem", data->app);
ofono_ussd_create(modem, 0, "atmodem", data->app);
if (!g_strcmp0(model, GEMALTO_MODEL_ELS81x))
ofono_netmon_create(modem, OFONO_VENDOR_GEMALTO,
"gemaltomodem", data->app);

View File

@@ -44,11 +44,11 @@ static GSList *g_drivers = NULL;
struct ofono_radio_settings {
DBusMessage *pending;
int flags;
enum ofono_radio_access_mode mode;
unsigned int mode;
enum ofono_radio_band_gsm band_gsm;
enum ofono_radio_band_umts band_umts;
ofono_bool_t fast_dormancy;
enum ofono_radio_access_mode pending_mode;
unsigned int pending_mode;
enum ofono_radio_band_gsm pending_band_gsm;
enum ofono_radio_band_umts pending_band_umts;
ofono_bool_t fast_dormancy_pending;
@@ -60,7 +60,7 @@ struct ofono_radio_settings {
struct ofono_atom *atom;
};
static const char *radio_access_mode_to_string(enum ofono_radio_access_mode m)
static const char *radio_access_mode_to_string(unsigned int m)
{
switch (m) {
case OFONO_RADIO_ACCESS_MODE_ANY:
@@ -79,11 +79,14 @@ static const char *radio_access_mode_to_string(enum ofono_radio_access_mode m)
if (m == (OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS))
return "lte,umts";
if (m == (OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM))
return "lte,gsm";
return NULL;
}
static gboolean radio_access_mode_from_string(const char *str,
enum ofono_radio_access_mode *mode)
unsigned int *mode)
{
if (g_str_equal(str, "any")) {
@@ -104,6 +107,9 @@ static gboolean radio_access_mode_from_string(const char *str,
} else if (g_str_equal(str, "lte,umts")) {
*mode = OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS;
return TRUE;
} else if (g_str_equal(str, "lte,gsm")) {
*mode = OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM;
return TRUE;
}
return FALSE;
@@ -373,7 +379,7 @@ static void radio_band_set_callback(const struct ofono_error *error,
}
static void radio_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode)
unsigned int mode)
{
DBusConnection *conn = ofono_dbus_get_connection();
const char *path;
@@ -522,8 +528,7 @@ static void radio_query_band(struct ofono_radio_settings *rs)
}
static void radio_rat_mode_query_callback(const struct ofono_error *error,
enum ofono_radio_access_mode mode,
void *data)
int mode, void *data)
{
struct ofono_radio_settings *rs = data;
DBusMessage *reply;
@@ -588,7 +593,7 @@ static DBusMessage *radio_set_property(DBusConnection *conn, DBusMessage *msg,
if (g_strcmp0(property, "TechnologyPreference") == 0) {
const char *value;
enum ofono_radio_access_mode mode;
unsigned int mode;
if (rs->driver->set_rat_mode == NULL)
return __ofono_error_not_implemented(msg);

View File

@@ -388,13 +388,12 @@ static void sim_fs_op_read_block_cb(const struct ofono_error *error,
if (op->current == start_block) {
bufoff = 0;
dataoff = op->offset % 256;
tocopy = MIN(256 - op->offset % 256,
op->num_bytes - op->current * 256);
tocopy = MIN(256 - dataoff, op->num_bytes);
} else {
bufoff = (op->current - start_block - 1) * 256 +
bufoff = (op->current - start_block) * 256 -
op->offset % 256;
dataoff = 0;
tocopy = MIN(256, op->num_bytes - op->current * 256);
tocopy = MIN(256, op->num_bytes - bufoff);
}
DBG("bufoff: %d, dataoff: %d, tocopy: %d",
@@ -463,13 +462,12 @@ static gboolean sim_fs_op_read_block(gpointer user_data)
bufoff = 0;
seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256 +
op->offset % 256;
toread = MIN(256 - op->offset % 256,
op->num_bytes - op->current * 256);
toread = MIN(256 - op->offset % 256, op->num_bytes);
} else {
bufoff = (op->current - start_block - 1) * 256 +
bufoff = (op->current - start_block) * 256 -
op->offset % 256;
seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256;
toread = MIN(256, op->num_bytes - op->current * 256);
toread = MIN(256, op->num_bytes - bufoff);
}
DBG("bufoff: %d, seekoff: %d, toread: %d",