[PATCH 01/14] test: fix bug in test-ss-control-cs
by Gustavo F. Padovan
---
test/test-ss-control-cs | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/test-ss-control-cs b/test/test-ss-control-cs
index bf59789..e04a4a0 100755
--- a/test/test-ss-control-cs
+++ b/test/test-ss-control-cs
@@ -29,7 +29,7 @@ if __name__ == "__main__":
cs.connect_to_signal("PropertyChanged", property_changed)
- ss = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ ss = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.SupplementaryServices')
print_properties(cs)
--
1.7.3.2
11 years, 9 months
Fix issue in stk null text string handling
by Jeevaka Badrappan
Hi,
As per the ETSI TS 102 223 specification section 6.5.4,
"If the terminal receives an icon, and either an empty or no alpha
identifier/text string is given by the UICC, than the terminal shall
reject the command with general result "Command data not understood by terminal".
In all the other cases, null text string(len=0) and empty text string(len=1)
are valid cases.
Following patch fixes the issue with no text string when icon is also supplied.
Regards,
Jeevaka
Jeevaka Badrappan (3):
stkutil: fix issue in null text string
stk: fix issue with null text string
unit: remove usage of empty text for null case
src/stk.c | 42 ++++++++++++++++++++++++++++++++----------
src/stkutil.c | 4 ++--
unit/test-stkutil.c | 5 +----
3 files changed, 35 insertions(+), 16 deletions(-)
11 years, 9 months
[PATCH] TODO: add SIM authentication
by Pekka.Pessi@nokia.com
From: Pekka Pessi <Pekka.Pessi(a)nokia.com>
---
TODO | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/TODO b/TODO
index 8d771d6..894b748 100644
--- a/TODO
+++ b/TODO
@@ -141,6 +141,12 @@ SIM / SIM File system
Complexity: C1
Owner: Marit Henriksen <marit.henriksen(a)stericsson.com>
+- Support SIM authentication: EAP-SIM, EAP-AKA, IMS-AKA and GBA.
+
+ Priority: Medium
+ Complexity: C2
+ Owner: Pekka Pessi <pekka.pessi(a)nokia.com>
+
Modem Emulator
==============
--
1.7.1
11 years, 9 months
[sim-ready PATCHv3 0/3] ofono_sim_ready_notify
by Pekka.Pessi@nokia.com
From: Pekka Pessi <Pekka.Pessi(a)nokia.com>
Hi all,
Here is my 4th stab at the ofono_sim_ready_notify().
The ofono_sim_ready_notify() is now always expected after call to
query_passwd_state.
When ofono_sim_ready_notify() is invoked, it checks that the call is
expected and if needed, retries the query_passwd_state, otherwise it
proceeds with sim initialization.
The patches has now been tested with the PIN and PUK codes with mbm and
the new isimodem sim driver by Jukka Saunamaki.
--Pekka
Jukka Saunamaki (1):
isimodem/sim: added PIN and SIM state handling
Pekka Pessi (2):
sim: add ofono_sim_ready_notify
atmodem/sim: use ofono_sim_ready_notify
drivers/atmodem/sim.c | 166 ++++++++++-----
drivers/isimodem/debug.c | 32 +++
drivers/isimodem/debug.h | 3 +
drivers/isimodem/sim.c | 537 +++++++++++++++++++++++++++++++++++++++++++---
drivers/isimodem/sim.h | 50 +++++-
include/sim.h | 2 +
src/sim.c | 56 ++++--
7 files changed, 747 insertions(+), 99 deletions(-)
11 years, 9 months
[PATCH] network: query signal strength when status changes to registered or roaming.
by Marit Henriksen
From: Marit Henriksen <marit.henriksen(a)stericsson.com>
Signal strength is set to -1 whenever registration status changes
and differs from registered or roaming. When registration status
changes again to registered or roaming, the signal strength needs to
be updated, so add query towards driver to get it.
---
src/network.c | 29 ++++++++++++++++-------------
1 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/src/network.c b/src/network.c
index d5b42a1..80fa83d 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1296,6 +1296,19 @@ emit:
notify_status_watches(netreg);
}
+static void signal_strength_callback(const struct ofono_error *error,
+ int strength, void *data)
+{
+ struct ofono_netreg *netreg = data;
+
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+ DBG("Error during signal strength query");
+ return;
+ }
+
+ ofono_netreg_strength_notify(netreg, strength);
+}
+
void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status,
int lac, int ci, int tech)
{
@@ -1319,6 +1332,9 @@ void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status,
if (netreg->driver->current_operator)
netreg->driver->current_operator(netreg,
current_operator_callback, netreg);
+ if (netreg->driver->strength)
+ netreg->driver->strength(netreg,
+ signal_strength_callback, netreg);
} else {
struct ofono_error error;
@@ -1345,19 +1361,6 @@ void ofono_netreg_time_notify(struct ofono_netreg *netreg,
__ofono_nettime_info_received(modem, info);
}
-static void signal_strength_callback(const struct ofono_error *error,
- int strength, void *data)
-{
- struct ofono_netreg *netreg = data;
-
- if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
- DBG("Error during signal strength query");
- return;
- }
-
- ofono_netreg_strength_notify(netreg, strength);
-}
-
static void init_registration_status(const struct ofono_error *error,
int status, int lac, int ci, int tech,
void *data)
--
1.7.1
11 years, 9 months
[PATCH] zte: poll sim before sim_inserted_notify
by Pekka.Pessi@nokia.com
From: Pekka Pessi <Pekka.Pessi(a)nokia.com>
Ensure that SIM is ready before calling ofono_sim_inserted_notify().
---
plugins/zte.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 52 insertions(+), 5 deletions(-)
diff --git a/plugins/zte.c b/plugins/zte.c
index 82f322a..50f6280 100644
--- a/plugins/zte.c
+++ b/plugins/zte.c
@@ -55,6 +55,9 @@ struct zte_data {
GAtChat *aux;
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
+ struct ofono_sim *sim;
+ guint poll_source;
+ guint poll_count;
};
static int zte_probe(struct ofono_modem *modem)
@@ -221,6 +224,13 @@ static int zte_disable(struct ofono_modem *modem)
if (data->aux == NULL)
return 0;
+ data->sim = NULL;
+
+ if (data->poll_source) {
+ g_source_remove(data->poll_source);
+ data->poll_source = 0;
+ }
+
g_at_chat_cancel_all(data->aux);
g_at_chat_unregister_all(data->aux);
g_at_chat_send(data->aux, "AT+CFUN=0", none_prefix,
@@ -262,19 +272,56 @@ error:
CALLBACK_WITH_FAILURE(cb, cbd->data);
}
+static gboolean poll_sim(gpointer user_data);
+
+static void sim_poll_result(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct zte_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ if (ok) {
+ ofono_sim_inserted_notify(data->sim, ok);
+ return;
+ }
+
+ if (++data->poll_count > 5)
+ /* Give up after 5 seconds - there is probably no SIM */
+ return;
+
+ data->poll_source = g_timeout_add_seconds(1, poll_sim, modem);
+}
+
+static gboolean poll_sim(gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct zte_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ data->poll_source = 0;
+
+ g_at_chat_send(data->aux, "AT+CPIN?", none_prefix,
+ sim_poll_result, modem, NULL);
+
+ return FALSE;
+}
+
static void zte_pre_sim(struct ofono_modem *modem)
{
struct zte_data *data = ofono_modem_get_data(modem);
- struct ofono_sim *sim;
DBG("%p", modem);
ofono_devinfo_create(modem, 0, "atmodem", data->aux);
- sim = ofono_sim_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
- "atmodem", data->aux);
- if (sim)
- ofono_sim_inserted_notify(sim, TRUE);
+ data->poll_count = 0;
+
+ data->sim = ofono_sim_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
+ "atmodem", data->aux);
+ if (data->sim)
+ poll_sim(modem);
}
static void zte_post_sim(struct ofono_modem *modem)
--
1.7.1
11 years, 9 months
[PATCH 3/5] cdma-atmodem: Add CDMA MO Call Support
by Dara Spieker-Doyle
---
Makefile.am | 7 ++
configure.ac | 5 +
drivers/cdma-atmodem/atmodem.c | 47 +++++++++
drivers/cdma-atmodem/atmodem.h | 26 +++++
drivers/cdma-atmodem/atutil.c | 45 +++++++++
drivers/cdma-atmodem/atutil.h | 65 +++++++++++++
drivers/cdma-atmodem/voicecall.c | 195 ++++++++++++++++++++++++++++++++++++++
7 files changed, 390 insertions(+), 0 deletions(-)
create mode 100644 drivers/cdma-atmodem/atmodem.c
create mode 100644 drivers/cdma-atmodem/atmodem.h
create mode 100644 drivers/cdma-atmodem/atutil.c
create mode 100644 drivers/cdma-atmodem/atutil.h
create mode 100644 drivers/cdma-atmodem/voicecall.c
diff --git a/Makefile.am b/Makefile.am
index f111f96..9aac08b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -242,6 +242,13 @@ conf_DATA += plugins/phonesim.conf
endif
endif
+if CDMA_ATMODEM
+builtin_modules += cdma_atmodem
+builtin_sources += drivers/cdma-atmodem/atmodem.c \
+ drivers/cdma-atmodem/atmodem.h \
+ drivers/cdma-atmodem/voicecall.c
+endif
+
builtin_modules += g1
builtin_sources += plugins/g1.c
diff --git a/configure.ac b/configure.ac
index 0c1986a..090f3ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,11 @@ AC_ARG_ENABLE(atmodem, AC_HELP_STRING([--disable-atmodem],
[enable_atmodem=${enableval}])
AM_CONDITIONAL(ATMODEM, test "${enable_atmodem}" != "no")
+AC_ARG_ENABLE(cdmaatmodem, AC_HELP_STRING([--disable-cdma-atmodem],
+ [disable CDMA AT modem support]),
+ [enable_cdma_atmodem=${enableval}])
+AM_CONDITIONAL(CDMA_ATMODEM, test "${enable_cdma_atmodem}" != "no")
+
AC_ARG_ENABLE(phonesim, AC_HELP_STRING([--disable-phonesim],
[disable Phone simulator support]),
[enable_phonesim=${enableval}])
diff --git a/drivers/cdma-atmodem/atmodem.c b/drivers/cdma-atmodem/atmodem.c
new file mode 100644
index 0000000..86dd074
--- /dev/null
+++ b/drivers/cdma-atmodem/atmodem.c
@@ -0,0 +1,47 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2010 Nokia Corporation. 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 <glib.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/types.h>
+
+#include "atmodem.h"
+
+static int cdma_atmodem_init(void)
+{
+ cdma_at_voicecall_init();
+
+ return 0;
+}
+
+static void cdma_atmodem_exit(void)
+{
+ cdma_at_voicecall_exit();
+}
+
+OFONO_PLUGIN_DEFINE(cdma_atmodem, "CDMA AT modem driver", VERSION,
+ OFONO_PLUGIN_PRIORITY_DEFAULT, cdma_atmodem_init, cdma_atmodem_exit)
diff --git a/drivers/cdma-atmodem/atmodem.h b/drivers/cdma-atmodem/atmodem.h
new file mode 100644
index 0000000..32facbc
--- /dev/null
+++ b/drivers/cdma-atmodem/atmodem.h
@@ -0,0 +1,26 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2010 Nokia Corporation. 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
+ *
+ */
+
+extern void cdma_at_voicecall_init();
+extern void cdma_at_voicecall_exit();
+
+extern void cdma_at_devinfo_init();
+extern void cdma_at_devinfo_exit();
diff --git a/drivers/cdma-atmodem/atutil.c b/drivers/cdma-atmodem/atutil.c
new file mode 100644
index 0000000..b58c1ee
--- /dev/null
+++ b/drivers/cdma-atmodem/atutil.c
@@ -0,0 +1,45 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2010 Nokia Corporation. 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 <glib.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/log.h>
+#include <ofono/types.h>
+
+#include "atutil.h"
+
+void decode_at_error(struct ofono_error *error, const char *final)
+{
+ if (!strcmp(final, "OK")) {
+ error->type = OFONO_ERROR_TYPE_NO_ERROR;
+ error->error = 0;
+ } else {
+ error->type = OFONO_ERROR_TYPE_FAILURE;
+ error->error = 0;
+ }
+}
diff --git a/drivers/cdma-atmodem/atutil.h b/drivers/cdma-atmodem/atutil.h
new file mode 100644
index 0000000..9a7c5e1
--- /dev/null
+++ b/drivers/cdma-atmodem/atutil.h
@@ -0,0 +1,65 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2010 Nokia Corporation. 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
+ *
+ */
+
+#ifndef __AT_UTIL_H
+#define __AT_UTIL_H
+
+void decode_at_error(struct ofono_error *error, const char *final);
+
+struct cb_data {
+ void *cb;
+ void *data;
+ void *user;
+};
+
+static inline struct cb_data *cb_data_new(void *cb, void *data)
+{
+ struct cb_data *ret;
+
+ ret = g_try_new0(struct cb_data, 1);
+
+ if (ret == NULL)
+ return ret;
+
+ ret->cb = cb;
+ ret->data = data;
+
+ return ret;
+}
+
+#define CALLBACK_WITH_FAILURE(cb, args...) \
+ do { \
+ struct ofono_error cb_e; \
+ cb_e.type = OFONO_ERROR_TYPE_FAILURE; \
+ cb_e.error = 0; \
+ \
+ cb(&cb_e, ##args); \
+ } while (0) \
+
+#define CALLBACK_WITH_SUCCESS(f, args...) \
+ do { \
+ struct ofono_error e; \
+ e.type = OFONO_ERROR_TYPE_NO_ERROR; \
+ e.error = 0; \
+ f(&e, ##args); \
+ } while (0) \
+
+#endif /* __AT_UTIL_H */
diff --git a/drivers/cdma-atmodem/voicecall.c b/drivers/cdma-atmodem/voicecall.c
new file mode 100644
index 0000000..efae370
--- /dev/null
+++ b/drivers/cdma-atmodem/voicecall.c
@@ -0,0 +1,195 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2010 Nokia Corporation. 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
+
+#define _GNU_SOURCE
+#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/cdma-voicecall.h>
+
+#include "gatchat.h"
+#include "gatresult.h"
+
+#include "atutil.h"
+#include "atmodem.h"
+
+static const char *none_prefix[] = { NULL };
+
+struct voicecall_driver {
+ struct ofono_cdma_voicecall_manager *vc;
+ unsigned int local_release;
+ GAtChat *chat;
+ unsigned int vendor;
+};
+
+struct change_state_req {
+ struct ofono_cdma_voicecall_manager *vc;
+ ofono_cdma_voicecall_cb_t cb;
+ void *data;
+};
+
+static void at_dial_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_cdma_voicecall_cb_t cb = cbd->cb;
+ GAtResultIter iter;
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok)
+ goto out;
+
+ g_at_result_iter_init(&iter, result);
+
+out:
+ cb(&error, cbd->data);
+}
+
+static void at_dial(struct ofono_cdma_voicecall_manager *vc,
+ const struct ofono_cdma_phone_number *ph,
+ ofono_cdma_voicecall_cb_t cb, void *data)
+{
+ struct voicecall_driver *vd = ofono_cdma_voicecall_manager_get_data(vc);
+ struct cb_data *cbd = cb_data_new(cb, data);
+ char buf[256];
+
+ if (cbd == NULL)
+ goto error;
+
+ cbd->user = vc;
+
+ snprintf(buf, sizeof(buf), "AT+CDV=%s", ph->number);
+
+ if (g_at_chat_send(vd->chat, buf, none_prefix,
+ at_dial_cb, cbd, g_free) > 0)
+ return;
+
+error:
+ g_free(cbd);
+
+ CALLBACK_WITH_FAILURE(cb, data);
+}
+
+static void at_template(const char *cmd,
+ struct ofono_cdma_voicecall_manager *vc,
+ GAtResultFunc result_cb,
+ ofono_cdma_voicecall_cb_t cb, void *data)
+{
+ struct voicecall_driver *vd = ofono_cdma_voicecall_manager_get_data(vc);
+ struct change_state_req *req = g_try_new0(struct change_state_req, 1);
+
+ if (req == NULL)
+ goto error;
+
+ req->vc = vc;
+ req->cb = cb;
+ req->data = data;
+
+ if (g_at_chat_send(vd->chat, cmd, none_prefix,
+ result_cb, req, g_free) > 0)
+ return;
+
+error:
+ g_free(req);
+
+ CALLBACK_WITH_FAILURE(cb, data);
+}
+
+static void at_hangup_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct change_state_req *req = user_data;
+
+ if (!ok) {
+ ofono_error("hangup failed.");
+ return;
+ }
+
+ ofono_cdma_voicecall_manager_disconnected(req->vc,
+ OFONO_DISCONNECT_REASON_LOCAL_HANGUP, NULL);
+ CALLBACK_WITH_SUCCESS(req->cb, req->data);
+
+}
+
+static void at_hangup(struct ofono_cdma_voicecall_manager *vc,
+ ofono_cdma_voicecall_cb_t cb, void *data)
+{
+ /* Hangup active call */
+ at_template("AT+CHV", vc, at_hangup_cb, cb, data);
+}
+
+static int at_voicecall_probe(struct ofono_cdma_voicecall_manager *vc,
+ unsigned int vendor, void *data)
+{
+ GAtChat *chat = data;
+ struct voicecall_driver *vd;
+
+ vd = g_try_new0(struct voicecall_driver, 1);
+ if (vd == NULL)
+ return -ENOMEM;
+
+ vd->chat = g_at_chat_clone(chat);
+ vd->vendor = vendor;
+
+ ofono_cdma_voicecall_manager_set_data(vc, vd);
+
+ ofono_cdma_voicecall_manager_register(vc);
+
+ return 0;
+}
+
+static void at_voicecall_remove(struct ofono_cdma_voicecall_manager *vc)
+{
+ struct voicecall_driver *vd = ofono_cdma_voicecall_manager_get_data(vc);
+
+ ofono_cdma_voicecall_manager_set_data(vc, NULL);
+
+ g_at_chat_unref(vd->chat);
+ g_free(vd);
+}
+
+static struct ofono_cdma_voicecall_manager_driver driver = {
+ .name = "cdma-atmodem",
+ .probe = at_voicecall_probe,
+ .remove = at_voicecall_remove,
+ .dial = at_dial,
+ .hangup = at_hangup,
+};
+
+void cdma_at_voicecall_init()
+{
+ ofono_cdma_voicecall_manager_driver_register(&driver);
+}
+
+void cdma_at_voicecall_exit()
+{
+ ofono_cdma_voicecall_manager_driver_unregister(&driver);
+}
--
1.7.0.4
11 years, 9 months
[PATCH] test-stkutil: Modify the check logic of time zone
by Yang Gu
---
unit/test-stkutil.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 868d54b..666f4eb 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -245,7 +245,11 @@ static void check_gsm_sms(const struct sms *command,
g_assert(ca->hour == ta->hour);
g_assert(ca->minute == ta->minute);
g_assert(ca->second == ta->second);
- g_assert(ca->timezone == ta->timezone);
+ g_assert(ca->has_timezone == ta->has_timezone);
+
+ if (ta->has_timezone)
+ g_assert(ca->timezone == ta->timezone);
+
break;
}
case SMS_VALIDITY_PERIOD_FORMAT_ENHANCED:
--
1.7.2.3
11 years, 9 months
plugins/udev.c: add_modem() problem
by Rafael Ignacio Zurita
Hello, current ofono git version is showing me an odd behaviour on our
netbook today. Before, I have been working with ofonod without problems (the
netbook has a mbmmodem: Dell Computer Corp. F3507g Mobile Broadband Module)
But now, ofonod does not detect properly the devices and their drivers, so I am
trying to debug further.
When it worked okey the output was (I just put here the interesting output parts) :
export OFONO_AT_DEBUG=1
./src/ofonod -n -d
ofonod[3381]: src/nettime.c:ofono_nettime_driver_register() driver: 0x8104b38 name: Example Network Time
ofonod[3381]: src/history.c:ofono_history_driver_register() driver: 0x8104b00 name: Example Call History
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x8104a80, name: ste
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x8104a20, name: ifx
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x81049c0, name: palmpre
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x81048e0, name: hfp
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x8104880, name: nokia
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x8104820, name: novatel
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x81047c0, name: huawei
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x8104760, name: zte
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x8104700, name: hso
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x81046a0, name: mbm
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x8104640, name: calypso
ofonod[3381]: src/modem.c:ofono_modem_driver_register() driver: 0x81045e0, name: wavecom
...
ofonod[3381]: src/radio-settings.c:ofono_radio_settings_driver_register() driver: 0x81038e0, name: isimodem
ofonod[3381]: src/gprs.c:ofono_gprs_driver_register() driver: 0x8103904, name: isimodem
ofonod[3381]: src/gprs.c:ofono_gprs_context_driver_register() driver: 0x8103918, name: isimodem
ofonod[3381]: src/audio-settings.c:ofono_audio_settings_driver_register() driver: 0x810392c, name: isimodem
ofonod[3381]: src/modem.c:ofono_modem_create() name: 3558620212509920, type: mbm
ofonod[3381]: src/modem.c:set_modem_property() modem 0xa103178 property Path
ofonod[3381]: src/modem.c:set_modem_property() modem 0xa103178 property Registered
ofonod[3381]: plugins/udev.c:add_modem() /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.1/tty/ttyACM0 (mbm)
ofonod[3381]: plugins/udev.c:add_mbm() desc: Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property Registered
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property ModemDevice
ofonod[3381]: src/modem.c:set_modem_property() modem 0xa103178 property ModemDevice
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property ModemDevice
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property DataDevice
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property NetworkInterface
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property GPSDevice
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property Path
ofonod[3381]: plugins/udev.c:add_modem() /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.3/tty/ttyACM1 (mbm)
ofonod[3381]: plugins/udev.c:add_mbm() desc: Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem 2
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property Registered
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property ModemDevice
ofonod[3381]: src/modem.c:set_modem_property() modem 0xa103178 property DataDevice
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property ModemDevice
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property DataDevice
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property NetworkInterface
ofonod[3381]: src/modem.c:get_modem_property() modem 0xa103178 property GPSDevice
...
(it shows the add_modem(), add_mbm(), etc). And the test/* scripts worked well
(list-modems, enable-modem, online-modem).
Then, I guess that something changed (but I am trying to find what) and ofonod
does not find the modem anymore. The new ofonod output (check how it does not
find the ttyACM* mbm modem anymore) is :
root@profusion-Inspiron-1010:/home/profusion/rafa/latest/ofono# ./src/ofonod -n -d
ofonod[11030]: oFono version 0.36
ofonod[11030]: src/plugin.c:__ofono_plugin_init()
ofonod[11030]: plugins/push-notification.c:push_notification_init()
ofonod[11030]: plugins/smart-messaging.c:smart_messaging_init()
ofonod[11030]: src/nettime.c:ofono_nettime_driver_register() driver: 0x8103b18 name: Example Network Time
ofonod[11030]: src/history.c:ofono_history_driver_register() driver: 0x8103ae0 name: Example Call History
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103a60, name: ste
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103a00, name: ifx
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x81039a0, name: palmpre
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x81038c0, name: hfp
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103860, name: nokia
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103800, name: novatel
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x81037a0, name: huawei
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103740, name: zte
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x81036e0, name: hso
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103680, name: mbm
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103620, name: calypso
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x81035c0, name: wavecom
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103560, name: g1
ofonod[11030]: src/modem.c:ofono_modem_driver_register() driver: 0x8103500, name: phonesim
...
ofonod[11030]: src/radio-settings.c:ofono_radio_settings_driver_register() driver: 0x81028e0, name: isimodem
ofonod[11030]: src/gprs.c:ofono_gprs_driver_register() driver: 0x8102904, name: isimodem
ofonod[11030]: src/gprs.c:ofono_gprs_context_driver_register() driver: 0x8102918, name: isimodem
ofonod[11030]: src/audio-settings.c:ofono_audio_settings_driver_register() driver: 0x810292c, name: isimodem
ofonod[11030]: plugins/bluetooth.c:manager_properties_cb()
ofonod[11030]: plugins/bluetooth.c:parse_adapters()
ofonod[11030]: plugins/bluetooth.c:parse_adapters() Calling GetProperties on /org/bluez/1056/hci0
ofonod[11030]: plugins/bluetooth.c:parse_devices()
ofonod[11030]: plugins/bluetooth.c:adapter_properties_cb() Adapter Address: 00:22:69:C7:85:89, Path: /org/bluez/1056/hci0
^Cofonod[11030]: src/plugin.c:__ofono_plugin_cleanup()
ofonod[11030]: plugins/push-notification.c:push_notification_exit()
ofonod[11030]: plugins/smart-messaging.c:smart_messaging_exit()
list-modes, enable-modem, etc did not work either. (And then I did CTRL+C to
finish.)
With a bit of debug it shows something weird. I found that
plugins/udev.c:add_modem() is called, but for some reason it does not have the same
behaviour than before.
The patch below is a little of debug added to add_modem()
diff --git a/plugins/udev.c b/plugins/udev.c
index 255755e..a877b59 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -453,9 +453,12 @@ static void add_modem(struct udev_device *udev_device)
{
struct ofono_modem *modem;
struct udev_device *parent;
- const char *devpath, *curpath, *driver;
+ const char *devpath, *curpath, *driver, *subsystem;
+ devpath = udev_device_get_devpath(udev_device);
+ subsystem = udev_device_get_subsystem(udev_device);
driver = get_driver(udev_device);
+ DBG("devpath : %s - driver : %s - subsystem : %s", devpath, driver, subsystem);
if (driver != NULL) {
devpath = udev_device_get_devpath(udev_device);
if (devpath == NULL)
@@ -476,13 +479,22 @@ static void add_modem(struct udev_device *udev_device)
if (parent == NULL)
return;
+ devpath = udev_device_get_devpath(parent);
+ subsystem = udev_device_get_subsystem(parent);
driver = get_driver(parent);
+ DBG("devpath : %s - driver : %s - subsystem : %s", devpath, driver, subsystem);
if (driver == NULL) {
parent = udev_device_get_parent(parent);
+ devpath = udev_device_get_devpath(parent);
+ subsystem = udev_device_get_subsystem(parent);
driver = get_driver(parent);
+ DBG("devpath : %s - driver : %s - subsystem : %s", devpath, driver, subsystem);
if (driver == NULL) {
parent = udev_device_get_parent(parent);
driver = get_driver(parent);
+ devpath = udev_device_get_devpath(parent);
+ subsystem = udev_device_get_subsystem(parent);
+ DBG("devpath : %s - driver : %s - subsystem : %s", devpath, driver, subsystem);
if (driver == NULL)
return;
}
And this is the ofonod output with that patch applied :
root@profusion-Inspiron-1010:/home/profusion/rafa/latest/ofono# ./src/ofonod -n -d
ofonod[11388]: oFono version 0.36
ofonod[11388]: src/plugin.c:__ofono_plugin_init()
ofonod[11388]: plugins/push-notification.c:push_notification_init()
ofonod[11388]: plugins/smart-messaging.c:smart_messaging_init()
ofonod[11388]: src/nettime.c:ofono_nettime_driver_register() driver: 0x8103b18 name: Example Network Time
ofonod[11388]: src/history.c:ofono_history_driver_register() driver: 0x8103ae0 name: Example Call History
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103a60, name: ste
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103a00, name: ifx
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x81039a0, name: palmpre
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x81038c0, name: hfp
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103860, name: nokia
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103800, name: novatel
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x81037a0, name: huawei
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103740, name: zte
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x81036e0, name: hso
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103680, name: mbm
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103620, name: calypso
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x81035c0, name: wavecom
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103560, name: g1
ofonod[11388]: src/modem.c:ofono_modem_driver_register() driver: 0x8103500, name: phonesim
ofonod[11388]: src/gprs.c:ofono_gprs_context_driver_register() driver: 0x81034ec, name: phonesim
...
ofonod[11388]: src/radio-settings.c:ofono_radio_settings_driver_register() driver: 0x81028e0, name: isimodem
ofonod[11388]: src/gprs.c:ofono_gprs_driver_register() driver: 0x8102904, name: isimodem
ofonod[11388]: src/gprs.c:ofono_gprs_context_driver_register() driver: 0x8102918, name: isimodem
ofonod[11388]: src/audio-settings.c:ofono_audio_settings_driver_register() driver: 0x810292c, name: isimodem
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.1/tty/ttyACM0 - driver : (null) - subsystem : tty
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.1 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.3/tty/ttyACM1 - driver : (null) - subsystem : tty
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.3 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.7/net/wwan0 - driver : (null) - subsystem : net
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.7 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.9/tty/ttyACM2 - driver : (null) - subsystem : tty
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.9 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1/1-5 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/pci0000:00/0000:00:1d.7/usb1 - driver : (null) - subsystem : usb
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/platform/serial8250/tty/ttyS0 - driver : (null) - subsystem : tty
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/platform/serial8250 - driver : (null) - subsystem : platform
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/platform - driver : (null) - subsystem : (null)
ofonod[11388]: plugins/udev.c:add_modem() devpath : (null) - driver : (null) - subsystem : (null)
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/platform/serial8250/tty/ttyS1 - driver : (null) - subsystem : tty
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/platform/serial8250 - driver : (null) - subsystem : platform
ofonod[11388]: plugins/udev.c:add_modem() devpath : /devices/platform - driver : (null) - subsystem : (null)
Then I checked a bit the system..
The system reports this information about the mbmmodem :
# lsusb
Bus 001 Device 003: ID 413c:8147 Dell Computer Corp. F3507g Mobile Broadband Module
root@profusion-Inspiron-1010:/home/profusion/rafa/latest/ofono# dmesg | grep -i cdc
[ 11.079706] usbcore: registered new interface driver cdc_acm
[ 11.079716] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
[ 3137.190284] cdc_acm 1-5:1.1: ttyACM0: USB ACM device
[ 3137.192278] cdc_acm 1-5:1.3: ttyACM1: USB ACM device
[ 3137.194623] cdc_acm 1-5:1.9: ttyACM2: USB ACM device
root@profusion-Inspiron-1010:/home/profusion/rafa/latest/ofono# lsusb -v | grep -i mobile
Bus 001 Device 003: ID 413c:8147 Dell Computer Corp. F3507g Mobile Broadband Module
idProduct 0x8147 F3507g Mobile Broadband Module
iProduct 2 Dell Wireless 5530 HSPA Mobile Broadband Minicard Device
iInterface 6 Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem
iInterface 7 Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem
iInterface 8 Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem 2
iInterface 9 Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem 2
iInterface 10 Dell Wireless 5530 HSPA Mobile Broadband Minicard
iInterface 11 Dell Wireless 5530 HSPA Mobile Broadband Minicard PC SC Port
bInterfaceSubClass 10 Mobile Direct Line
iInterface 17 Dell Wireless 5530 HSPA Mobile Broadband Minicard GPS Port
iInterface 18 Dell Wireless 5530 HSPA Mobile Broadband Minicard GPS Port
iInterface 6 Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem
iInterface 7 Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem
iInterface 8 Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem 2
iInterface 9 Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem 2
iInterface 10 Dell Wireless 5530 HSPA Mobile Broadband Minicard
iInterface 11 Dell Wireless 5530 HSPA Mobile Broadband Minicard PC SC Port
bInterfaceSubClass 10 Mobile Direct Line
root@profusion-Inspiron-1010:/home/profusion/rafa/latest/ofono# udevadm info --name=/dev/ttyACM0 --attribute-walk
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.1/tty/ttyACM0':
KERNEL=="ttyACM0"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.1':
KERNELS=="1-5:1.1"
SUBSYSTEMS=="usb"
DRIVERS=="cdc_acm"
ATTRS{bInterfaceNumber}=="01"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bNumEndpoints}=="01"
ATTRS{bInterfaceClass}=="02"
ATTRS{bInterfaceSubClass}=="02"
ATTRS{bInterfaceProtocol}=="01"
ATTRS{modalias}=="usb:v413Cp8147d0000dc02dsc00dp00ic02isc02ip01"
ATTRS{supports_autosuspend}=="1"
ATTRS{interface}=="Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem"
ATTRS{bmCapabilities}=="7"
looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-5':
KERNELS=="1-5"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}=="WMC Device"
...
I see that, for example, udevadm info --name=/dev/ttyACM0 --attribute-walk
shows the proper parents and drivers for ttyACM0, but from the log of ofonod with
the debug patch added it does not get the proper "driver" for every
parent of every device.
Maybe I am missing something, but the system has not changed, so I guess
that I did something wrong. If you have suggestions let me know, I would like
to debug further.
Thanks in advance.
Rafael Zurita
11 years, 9 months
[PATCH 0/6] Add SIM Retry Counter
by Lucas De Marchi
These patches add SIM Retry counter feature to ofono and implement it for
huawei modem.
First two patches are only fixes for huawei when SIM card is initially locked and
were necessary in order to test the other patches. Without them ofono wrongly
reports as if the SIM was not present because there's not difference between
"invalid SIM" state and "locked SIM" state for huwaei.
The implementation reads only one "Retry Counter" that is the same as the one
being requested in PinRequired property. Another approach was to read all the
counters (e.g. huawei exports counters for PIN, PIN2, PUK and PUK2), but the
Dbus API to expose to user was not so clear to me if I used this approach.
What do you think?
Lucas De Marchi (6):
huawei: cancel poll timeout when going to a valid state
huawei: fix SIM state notification when locked
sim: add method to query SIM Retry Counter
sim: add PinRetries property
doc: detail PinRetries property
atmodem: implement method to query PIN Retry Counter
doc/sim-api.txt | 10 +++++++
drivers/atmodem/sim.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++
include/sim.h | 5 +++
plugins/huawei.c | 46 ++++++++++++++++++++++++++++++++
src/sim.c | 32 ++++++++++++++++++++++
5 files changed, 163 insertions(+), 0 deletions(-)
--
1.7.3.3
11 years, 9 months