All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] ISI modem version detection with plugin
@ 2011-02-01 14:13 Jessica Nilsson
  2011-02-01 14:13 ` [PATCH v2 1/3] u8500: add plugin for u8500 Jessica Nilsson
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Jessica Nilsson @ 2011-02-01 14:13 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

The same patch as before, but split up in three parts as per your suggestion.

As before, please note that this does not build unless the gisi patch
"gisi: Updated subscriptions and pipe handling to accomodate additional
isimodem versions" is added first. We are currently looking at your comments on
that one and will send in an update as soon as we can.

Best Regards,
Jessica Nilsson

  u8500: add plugin for u8500
  udev: u8500 support and style fix
  isimodem: header updates for ISI2.5

 Makefile.am                |    4 +
 drivers/isimodem/debug.c   |  132 ++++++++++++
 drivers/isimodem/debug.h   |    9 +
 drivers/isimodem/mtc.h     |   38 ++++
 drivers/isimodem/version.h |   26 +++
 plugins/ofono.rules        |    3 +
 plugins/u8500.c            |  507 ++++++++++++++++++++++++++++++++++++++++++++
 plugins/udev.c             |    5 +-
 8 files changed, 723 insertions(+), 1 deletions(-)
 create mode 100644 drivers/isimodem/version.h
 create mode 100644 plugins/u8500.c

--
1.7.3.5


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2 1/3] u8500: add plugin for u8500
  2011-02-01 14:13 [PATCH v2 0/3] ISI modem version detection with plugin Jessica Nilsson
@ 2011-02-01 14:13 ` Jessica Nilsson
  2011-02-01 15:41   ` Marcel Holtmann
  2011-02-01 14:13 ` [PATCH v2 2/3] udev: u8500 support and style fix Jessica Nilsson
  2011-02-01 14:13 ` [PATCH v2 3/3] isimodem: header updates for ISI2.5 Jessica Nilsson
  2 siblings, 1 reply; 17+ messages in thread
From: Jessica Nilsson @ 2011-02-01 14:13 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 14786 bytes --]

---
 Makefile.am         |    4 +
 plugins/ofono.rules |    3 +
 plugins/u8500.c     |  507 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 514 insertions(+), 0 deletions(-)
 create mode 100644 plugins/u8500.c

diff --git a/Makefile.am b/Makefile.am
index a38fcb9..4762cc8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -110,6 +110,7 @@ builtin_sources += $(gisi_sources) \
 				drivers/isimodem/mtc.h \
 				drivers/isimodem/debug.h \
 				drivers/isimodem/isiutil.h \
+				drivers/isimodem/version.h \
 				drivers/isimodem/debug.c \
 				drivers/isimodem/phonebook.c \
 				drivers/isimodem/devinfo.c \
@@ -144,6 +145,9 @@ builtin_sources += plugins/isiusb.c
 
 builtin_modules += n900
 builtin_sources += plugins/n900.c plugins/nokia-gpio.h plugins/nokia-gpio.c
+
+builtin_modules += u8500
+builtin_sources += plugins/u8500.c
 endif
 
 if ATMODEM
diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 111f071..333bff0 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -356,6 +356,9 @@ SUBSYSTEMS=="usb", ENV{OFONO_DRIVER}="isiusb", ENV{OFONO_ISI_ADDRESS}="16"
 # Nokia N900 modem
 SUBSYSTEMS=="hsi", ENV{OFONO_DRIVER}="n900", ENV{OFONO_ISI_ADDRESS}="108"
 
+# STE u8500
+KERNEL=="shrm0", ENV{OFONO_DRIVER}="u8500"
+
 LABEL="ofono_isi_end"
 
 SUBSYSTEM!="usb", GOTO="ofono_end"
diff --git a/plugins/u8500.c b/plugins/u8500.c
new file mode 100644
index 0000000..3a3b2bc
--- /dev/null
+++ b/plugins/u8500.c
@@ -0,0 +1,507 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2010  Nokia Corporation and/or its subsidiary(-ies).
+ *  Copyright (C) ST-Ericsson SA 2011.
+ *
+ *  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 <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
+
+#include <gisi/netlink.h>
+#include <gisi/modem.h>
+#include <gisi/client.h>
+#include <gisi/message.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/devinfo.h>
+#include <ofono/phonebook.h>
+#include <ofono/netreg.h>
+#include <ofono/voicecall.h>
+#include <ofono/sms.h>
+#include <ofono/cbs.h>
+#include <ofono/sim.h>
+#include <ofono/ussd.h>
+#include <ofono/ssn.h>
+#include <ofono/call-forwarding.h>
+#include <ofono/call-settings.h>
+#include <ofono/call-barring.h>
+#include <ofono/call-meter.h>
+#include <ofono/radio-settings.h>
+#include <ofono/gprs.h>
+#include <ofono/gprs-context.h>
+
+#include "drivers/isimodem/isimodem.h"
+#include "drivers/isimodem/isiutil.h"
+#include "drivers/isimodem/mtc.h"
+#include "drivers/isimodem/debug.h"
+#include "drivers/isimodem/version.h"
+
+struct isi_data {
+	char const *ifname;
+	GIsiModem *modem;
+	GIsiClient *client;
+	GIsiPhonetNetlink *link;
+	GIsiPhonetLinkState linkstate;
+	unsigned interval;
+	int reported;
+	ofono_bool_t online;
+	struct isi_cb_data *online_cbd;
+};
+
+static const GIsiVersion modemversion = {
+	.major = 2,
+	.minor = 5,
+};
+
+static gboolean check_response_status(const GIsiMessage *msg, uint8_t msgid)
+{
+	if (g_isi_msg_error(msg) < 0) {
+		DBG("Error: %s", strerror(-g_isi_msg_error(msg)));
+		return FALSE;
+	}
+
+	if (g_isi_msg_id(msg) != msgid) {
+		DBG("Unexpected msg: %s",
+			mce_message_id_name(g_isi_msg_id(msg)));
+		return FALSE;
+	}
+	return TRUE;
+}
+
+static void report_powered(struct ofono_modem *modem, struct isi_data *isi,
+				ofono_bool_t powered)
+{
+	if (powered == isi->reported)
+		return;
+
+	isi->reported = powered;
+	ofono_modem_set_powered(modem, powered);
+}
+
+static void report_online(struct isi_data *isi, ofono_bool_t online)
+{
+	struct isi_cb_data *cbd = isi->online_cbd;
+	ofono_modem_online_cb_t cb = cbd->cb;
+
+	isi->online_cbd = NULL;
+
+	if (isi->online == online)
+		CALLBACK_WITH_SUCCESS(cb, cbd->data);
+	else
+		CALLBACK_WITH_FAILURE(cb, cbd->data);
+
+	g_free(cbd);
+}
+
+static void set_power_by_mce_state(struct ofono_modem *modem,
+					struct isi_data *isi, int mce_state)
+{
+	switch (mce_state) {
+	case MCE_POWER_OFF:
+		report_powered(modem, isi, FALSE);
+		break;
+	case MCE_NORMAL:
+		if (isi->online_cbd)
+			report_online(isi, mce_state == MCE_NORMAL);
+	default:
+		report_powered(modem, isi, TRUE);
+	}
+}
+
+static void mce_state_ind_cb(const GIsiMessage *msg, void *data)
+{
+	struct ofono_modem *modem = data;
+	struct isi_data *isi = ofono_modem_get_data(modem);
+	uint8_t state;
+	uint8_t action;
+
+	if (!isi || g_isi_msg_id(msg) != MCE_MODEM_STATE_IND)
+		return;
+
+	if (!g_isi_msg_data_get_byte(msg, 0, &state) ||
+			!g_isi_msg_data_get_byte(msg, 1, &action))
+		return;
+
+	switch (action) {
+	case MCE_START:
+		DBG("target modem state: %s (0x%02X)",
+			mce_modem_state_name(state), state);
+		break;
+
+	case MCE_READY:
+		DBG("current modem state: %s (0x%02X)",
+			mce_modem_state_name(state), state);
+		set_power_by_mce_state(modem, isi, state);
+		break;
+	default:
+		break;
+	}
+}
+
+static void mce_rf_state_ind_cb(const GIsiMessage *msg, void *data)
+{
+	struct ofono_modem *modem = data;
+	struct isi_data *isi = ofono_modem_get_data(modem);
+	uint8_t state;
+	uint8_t action;
+
+	if (!isi || g_isi_msg_id(msg) != MCE_RF_STATE_IND)
+		return;
+
+	if (!g_isi_msg_data_get_byte(msg, 0, &state) ||
+			!g_isi_msg_data_get_byte(msg, 1, &action))
+		return;
+
+	switch (action) {
+	case MCE_READY:
+		DBG("current rf state: %s (0x%02X)",
+			mce_rf_state_name(state), state);
+		if (isi->online_cbd)
+			report_online(isi, state);
+		break;
+	case MCE_START:
+	default:
+		break;
+	}
+}
+
+static void mce_query_cb(const GIsiMessage *msg, void *data)
+{
+	struct ofono_modem *modem = data;
+	struct isi_data *isi = ofono_modem_get_data(modem);
+	uint8_t current;
+	uint8_t target;
+
+	if (!check_response_status(msg, MCE_MODEM_STATE_QUERY_RESP))
+		return;
+
+	if (!g_isi_msg_data_get_byte(msg, 0, &current) ||
+			!g_isi_msg_data_get_byte(msg, 1, &target))
+		return;
+
+	DBG("Modem state: current=%s (0x%02X) target=%s (0x%02X)",
+		mce_modem_state_name(current), current,
+		mce_modem_state_name(target), target);
+
+	if (current == target)
+		set_power_by_mce_state(modem, isi, current);
+}
+
+static gboolean bootstrap_current_state(gpointer user)
+{
+	struct ofono_modem *om = user;
+	struct isi_data *isi = ofono_modem_get_data(om);
+
+	const uint8_t req[] = {
+		MCE_MODEM_STATE_QUERY_REQ,
+		0x00, 0x00 /* Filler */
+	};
+	size_t len = sizeof(req);
+
+	g_isi_client_send(isi->client, req, len, mce_query_cb, om, NULL);
+
+	return FALSE;
+}
+
+static void reachable_cb(const GIsiMessage *msg, void *data)
+{
+	struct ofono_modem *om = data;
+	struct isi_data *isi = ofono_modem_get_data(om);
+
+	if (!g_isi_msg_error(msg) < 0)
+		return;
+
+	ISI_VERSION_DBG(msg);
+
+	g_isi_client_ind_subscribe(isi->client, MCE_MODEM_STATE_IND,
+					mce_state_ind_cb, om);
+
+	g_isi_client_ind_subscribe(isi->client, MCE_RF_STATE_IND,
+					mce_rf_state_ind_cb, om);
+
+	/*
+	 * FIXME: There is a theoretical race condition here:
+	 * g_isi_client_ind_subscribe() adds the actual message
+	 * sending for committing changes to subscriptions in idle
+	 * loop, which may or may not preserve ordering.  Thus, we
+	 * might miss a state indication if the bootstrap request ends
+	 * up being sent first.
+	 */
+	g_idle_add(bootstrap_current_state, om);
+}
+
+static void phonet_status_cb(GIsiModem *modem, GIsiPhonetLinkState st,
+				char const *ifname, void *data)
+{
+	struct ofono_modem *om = data;
+	struct isi_data *isi = ofono_modem_get_data(om);
+
+	DBG("Link %s (%u) is %s", isi->ifname, g_isi_modem_index(isi->modem),
+		st == PN_LINK_REMOVED ? "removed" :
+		st == PN_LINK_DOWN ? "down" : "up");
+
+	isi->linkstate = st;
+
+	if (st == PN_LINK_UP)
+		g_isi_client_verify(isi->client, reachable_cb, om, NULL);
+	else if (st == PN_LINK_DOWN)
+		set_power_by_mce_state(om, isi, MCE_POWER_OFF);
+}
+
+static int u8500_probe(struct ofono_modem *modem)
+{
+	const char *ifname = ofono_modem_get_string(modem, "Interface");
+	unsigned address = ofono_modem_get_integer(modem, "Address");
+	GIsiModem *isimodem;
+	GIsiClient *client = NULL;
+	GIsiPhonetNetlink *link = NULL;
+	struct isi_data *isi = NULL;
+
+	if (!ifname)
+		return -EINVAL;
+
+	DBG("(%p) with %s", modem, ifname);
+
+	isimodem = g_isi_modem_create_by_name(ifname);
+	if (!isimodem) {
+		DBG("Interface=%s: %s", ifname, strerror(errno));
+		return -errno;
+	}
+
+	if (!g_isi_modem_set_version(isimodem, modemversion))
+		return -EINVAL;
+
+	g_isi_modem_set_userdata(isimodem, modem);
+
+	if (getenv("OFONO_ISI_DEBUG"))
+		g_isi_modem_set_debug(isimodem, ofono_debug);
+
+	if (getenv("OFONO_ISI_TRACE"))
+		g_isi_modem_set_trace(isimodem, isi_trace);
+
+	if (g_isi_pn_netlink_by_modem(isimodem)) {
+		DBG("%s: %s", ifname, strerror(EBUSY));
+		errno = EBUSY;
+		goto error;
+	}
+
+	link = g_isi_pn_netlink_start(isimodem, phonet_status_cb, modem);
+	if (link == NULL) {
+		DBG("%s: %s", ifname, strerror(errno));
+		goto error;
+	}
+
+	if (address) {
+		int error = g_isi_pn_netlink_set_address(isimodem, address);
+		if (error && error != -EEXIST) {
+			DBG("g_isi_pn_netlink_set_address(): %s\n",
+				strerror(-error));
+			errno = -error;
+			goto error;
+		}
+	}
+
+	isi = g_try_new0(struct isi_data, 1);
+	if (!isi) {
+		errno = ENOMEM;
+		goto error;
+	}
+
+	client = g_isi_client_create(isimodem, PN_MODEM_MCE);
+	if (!client)
+		goto error;
+
+	isi->modem = isimodem;
+	isi->ifname = ifname;
+	isi->link = link;
+	isi->reported = -1;
+	isi->client = client;
+
+	ofono_modem_set_data(modem, isi);
+	return 0;
+
+error:
+	g_isi_pn_netlink_stop(link);
+	g_isi_client_destroy(client);
+	g_isi_modem_destroy(isimodem);
+	g_free(isi);
+
+	return -errno;
+}
+
+static void u8500_remove(struct ofono_modem *modem)
+{
+	struct isi_data *isi = ofono_modem_get_data(modem);
+
+	ofono_modem_set_data(modem, NULL);
+
+	if (isi == NULL)
+		return;
+
+	g_isi_pn_netlink_stop(isi->link);
+	g_isi_client_destroy(isi->client);
+	g_isi_modem_destroy(isi->modem);
+	g_free(isi);
+}
+
+static void mce_state_cb(const GIsiMessage *msg, void *data)
+{
+	struct isi_cb_data *cbd = data;
+	struct ofono_modem *modem = cbd->user;
+	ofono_modem_online_cb_t cb = cbd->cb;
+
+	struct isi_data *isi = ofono_modem_get_data(modem);
+	uint8_t cause;
+
+	if (!check_response_status(msg, MCE_RF_STATE_RESP))
+		goto error;
+
+	if (!g_isi_msg_data_get_byte(msg, 0, &cause))
+		goto error;
+
+	DBG("MCE cause: %s (0x%02X)", mce_status_info(cause), cause);
+
+	if (cause == MCE_OK) {
+		isi->online_cbd = cbd;
+		return;
+	}
+
+	if (cause == MCE_ALREADY_ACTIVE) {
+		CALLBACK_WITH_SUCCESS(cb, cbd->data);
+		g_free(cbd);
+		return;
+	}
+
+error:
+	CALLBACK_WITH_FAILURE(cb, cbd->data);
+	g_free(cbd);
+}
+
+static void u8500_online(struct ofono_modem *modem, ofono_bool_t online,
+				ofono_modem_online_cb_t cb, void *data)
+{
+	struct isi_data *isi = ofono_modem_get_data(modem);
+	struct isi_cb_data *cbd = isi_cb_data_new(modem, cb, data);
+	const uint8_t req[] = {
+		MCE_RF_STATE_REQ,
+		online ? MCE_RF_ON : MCE_RF_OFF,
+		0x00
+	};
+
+	DBG("(%p) with %s", modem, isi->ifname);
+
+	if (cbd == NULL || isi == NULL)
+		goto error;
+
+	if (g_isi_client_send_with_timeout(isi->client, req, sizeof(req),
+				MTC_STATE_REQ_TIMEOUT,
+				mce_state_cb, cbd, NULL)) {
+		isi->online = online;
+		return;
+	}
+
+error:
+	CALLBACK_WITH_FAILURE(cb, data);
+	g_free(cbd);
+}
+
+static void u8500_pre_sim(struct ofono_modem *modem)
+{
+	struct isi_data *isi = ofono_modem_get_data(modem);
+
+	DBG("(%p) with %s", modem, isi->ifname);
+
+	ofono_sim_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_devinfo_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_voicecall_create(modem, ISI_25, "isimodem", isi->modem);
+}
+
+static void u8500_post_sim(struct ofono_modem *modem)
+{
+	struct isi_data *isi = ofono_modem_get_data(modem);
+
+	DBG("(%p) with %s", modem, isi->ifname);
+
+	ofono_phonebook_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_call_forwarding_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_radio_settings_create(modem, ISI_25, "isimodem", isi->modem);
+}
+
+static void u8500_post_online(struct ofono_modem *modem)
+{
+	struct isi_data *isi = ofono_modem_get_data(modem);
+
+	DBG("(%p) with %s", modem, isi->ifname);
+
+	ofono_netreg_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_sms_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_cbs_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_ssn_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_ussd_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_call_settings_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_call_barring_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_call_meter_create(modem, ISI_25, "isimodem", isi->modem);
+	ofono_gprs_create(modem, ISI_25, "isimodem", isi->modem);
+}
+
+static int u8500_enable(struct ofono_modem *modem)
+{
+	return 0;
+}
+
+static int u8500_disable(struct ofono_modem *modem)
+{
+	return 0;
+}
+
+static struct ofono_modem_driver driver = {
+	.name = "u8500",
+	.probe = u8500_probe,
+	.remove = u8500_remove,
+	.set_online = u8500_online,
+	.pre_sim = u8500_pre_sim,
+	.post_sim = u8500_post_sim,
+	.post_online = u8500_post_online,
+	.enable = u8500_enable,
+	.disable = u8500_disable,
+};
+
+static int u8500_init(void)
+{
+	return ofono_modem_driver_register(&driver);
+}
+
+static void u8500_exit(void)
+{
+	ofono_modem_driver_unregister(&driver);
+}
+
+OFONO_PLUGIN_DEFINE(u8500, "Generic modem driver for isi",
+			VERSION, OFONO_PLUGIN_PRIORITY_DEFAULT,
+			u8500_init, u8500_exit)
-- 
1.7.3.5


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 2/3] udev: u8500 support and style fix
  2011-02-01 14:13 [PATCH v2 0/3] ISI modem version detection with plugin Jessica Nilsson
  2011-02-01 14:13 ` [PATCH v2 1/3] u8500: add plugin for u8500 Jessica Nilsson
@ 2011-02-01 14:13 ` Jessica Nilsson
  2011-02-01 15:39   ` Marcel Holtmann
  2011-02-01 14:13 ` [PATCH v2 3/3] isimodem: header updates for ISI2.5 Jessica Nilsson
  2 siblings, 1 reply; 17+ messages in thread
From: Jessica Nilsson @ 2011-02-01 14:13 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

---
 plugins/udev.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/plugins/udev.c b/plugins/udev.c
index ce1efe6..49b5eb8 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -185,7 +185,8 @@ static void add_hso(struct ofono_modem *modem,
 		devnode = udev_device_get_devnode(udev_device);
 
 		if (g_str_has_suffix(type, "Application") == TRUE)
-			ofono_modem_set_string(modem, APPLICATION_PORT, devnode);
+			ofono_modem_set_string(modem, APPLICATION_PORT,
+						devnode);
 		else if (g_str_has_suffix(type, "Control") == TRUE)
 			ofono_modem_set_string(modem, CONTROL_PORT, devnode);
 	} else if (g_str_equal(subsystem, "net") == TRUE) {
@@ -636,6 +637,8 @@ done:
 		add_nokia(modem, udev_device);
 	else if (g_strcmp0(driver, "isiusb") == 0)
 		add_isi(modem, udev_device);
+	else if (g_strcmp0(driver, "u8500") == 0)
+		add_isi(modem, udev_device);
 	else if (g_strcmp0(driver, "n900") == 0)
 		add_isi(modem, udev_device);
 	else if (g_strcmp0(driver, "gobi") == 0)
-- 
1.7.3.5


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-01 14:13 [PATCH v2 0/3] ISI modem version detection with plugin Jessica Nilsson
  2011-02-01 14:13 ` [PATCH v2 1/3] u8500: add plugin for u8500 Jessica Nilsson
  2011-02-01 14:13 ` [PATCH v2 2/3] udev: u8500 support and style fix Jessica Nilsson
@ 2011-02-01 14:13 ` Jessica Nilsson
  2011-02-01 15:43   ` Marcel Holtmann
  2 siblings, 1 reply; 17+ messages in thread
From: Jessica Nilsson @ 2011-02-01 14:13 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 7267 bytes --]

---
 drivers/isimodem/debug.c   |  132 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/isimodem/debug.h   |    9 +++
 drivers/isimodem/mtc.h     |   38 +++++++++++++
 drivers/isimodem/version.h |   26 +++++++++
 4 files changed, 205 insertions(+), 0 deletions(-)
 create mode 100644 drivers/isimodem/version.h

diff --git a/drivers/isimodem/debug.c b/drivers/isimodem/debug.c
index 3d667b4..8b5fa16 100644
--- a/drivers/isimodem/debug.c
+++ b/drivers/isimodem/debug.c
@@ -165,6 +165,138 @@ const char *mtc_modem_state_name(enum mtc_modem_state value)
 	return "MTC_<UNKNOWN>";
 }
 
+const char *mce_message_id_name(enum mce_message_id value)
+{
+	switch (value) {
+		_(MCE_MODEM_STATE_IND);
+		_(MCE_MODEM_STATE_QUERY_REQ);
+		_(MCE_MODEM_STATE_QUERY_RESP);
+		_(MCE_RF_STATE_REQ);
+		_(MCE_RF_STATE_RESP);
+		_(MCE_RF_STATE_IND);
+		_(MCE_RF_STATE_QUERY_REQ);
+		_(MCE_RF_STATE_QUERY_RESP);
+		_(MCE_POWER_OFF_REQ);
+		_(MCE_POWER_OFF_RESP);
+	}
+	return "MCE_<UNKNOWN>";
+}
+
+const char *mce_modem_state_name(enum mce_modem_state value)
+{
+	switch (value) {
+		_(MCE_NORMAL);
+		_(MCE_LOCAL);
+		_(MCE_SW_RESET);
+		_(MCE_POWER_OFF);
+	}
+	return "MCE_<UNKNOWN>";
+}
+
+const char *mce_status_info(enum mce_status_info value)
+{
+	switch (value) {
+		_(MCE_OK);
+		_(MCE_FAIL);
+		_(MCE_ALREADY_ACTIVE);
+		_(MCE_TRANSITION_ONGOING);
+	}
+	return "MCE_<UNKNOWN>";
+}
+
+const char *mce_rf_state_name(enum mce_rf_state value)
+{
+	switch (value) {
+		_(MCE_RF_OFF);
+		_(MCE_RF_ON);
+	}
+	return "MCE_RF<UNKNOWN>";
+}
+
+const char *uicc_status_name(uint8_t value)
+{
+	switch (value) {
+		/* Request performed successfully */
+		_(UICC_STATUS_OK);
+		/* Error in performing the command */
+		_(UICC_STATUS_FAIL);
+		/* Status is Unknown */
+		_(UICC_STATUS_UNKNOWN);
+		/* Server is not ready */
+		_(UICC_STATUS_NOT_READY);
+		/* Server start up is completed */
+		_(UICC_STATUS_START_UP_COMPLETED);
+		/* Server is shutting down */
+		_(UICC_STATUS_SHUTTING_DOWN);
+		/* Smart card is not ready */
+		_(UICC_STATUS_CARD_NOT_READY);
+		/* Smart card is ready */
+		_(UICC_STATUS_CARD_READY);
+		/* Smart card is disconnected */
+		_(UICC_STATUS_CARD_DISCONNECTED);
+		/* Smart card is not present */
+		_(UICC_STATUS_CARD_NOT_PRESENT);
+		/* Smart card has been rejected */
+		_(UICC_STATUS_CARD_REJECTED);
+		/* Application is active */
+		_(UICC_STATUS_APPL_ACTIVE);
+		/* Application is not active */
+		_(UICC_STATUS_APPL_NOT_ACTIVE);
+		/* PIN verification used */
+		_(UICC_STATUS_PIN_ENABLED);
+		/* PIN verification not used */
+		_(UICC_STATUS_PIN_DISABLED);
+	}
+	return "UICC_STATUS<UNKNOWN>";
+}
+
+const char *uicc_subblock_name(uint8_t value)
+{
+	switch (value) {
+		_(UICC_SB_SHUT_DOWN_CONFIG);
+		_(UICC_SB_CARD_STATUS);
+		_(UICC_SB_CARD_INFO);
+		_(UICC_SB_CARD_REJECT_CAUSE);
+		_(UICC_SB_CLIENT);
+		_(UICC_SB_APPL_DATA_OBJECT);
+		_(UICC_SB_APPLICATION);
+		_(UICC_SB_APPL_INFO);
+		_(UICC_SB_APPL_STATUS);
+		_(UICC_SB_FCP);
+		_(UICC_SB_FCI);
+		_(UICC_SB_CHV);
+		_(UICC_SB_PIN);
+		_(UICC_SB_PIN_REF);
+		_(UICC_SB_PUK);
+		_(UICC_SB_PIN_SUBST);
+		_(UICC_SB_PIN_INFO);
+		_(UICC_SB_APPL_PATH);
+		_(UICC_SB_SESSION);
+		_(UICC_SB_FILE_DATA);
+		_(UICC_SB_APDU);
+		_(UICC_SB_TRANSPARENT_READ);
+		_(UICC_SB_TRANSPARENT_UPDATE);
+		_(UICC_SB_TRANSPARENT);
+		_(UICC_SB_LINEAR_FIXED);
+		_(UICC_SB_CYCLIC);
+		_(UICC_SB_TERMINAL_PROFILE);
+		_(UICC_SB_TERMINAL_RESPONSE);
+		_(UICC_SB_ENVELOPE);
+		_(UICC_SB_POLLING_SET);
+		_(UICC_SB_REFRESH);
+		_(UICC_SB_AID);
+		_(UICC_SB_REFRESH_RESULT);
+		_(UICC_SB_APDU_ACTIONS);
+		_(UICC_SB_OBJECT_ID);
+		_(UICC_SB_STATUS_WORD);
+		_(UICC_SB_APDU_SAP_INFO);
+		_(UICC_SB_ACCESS_MODE);
+		_(UICC_SB_RESP_INFO);
+		_(UICC_SB_APDU_SAP_CONFIG);
+	}
+	return "UICC_<UNKNOWN>";
+}
+
 const char *sms_isi_cause_name(enum sms_isi_cause value)
 {
 	switch (value) {
diff --git a/drivers/isimodem/debug.h b/drivers/isimodem/debug.h
index e149c2c..db01f04 100644
--- a/drivers/isimodem/debug.h
+++ b/drivers/isimodem/debug.h
@@ -27,6 +27,7 @@
 #include "ss.h"
 #include "mtc.h"
 #include "sms.h"
+#include "uicc.h"
 #include "sim.h"
 #include "info.h"
 #include "call.h"
@@ -41,6 +42,14 @@ const char *ss_ussd_type_name(enum ss_ussd_type value);
 const char *mtc_isi_cause_name(enum mtc_isi_cause value);
 const char *mtc_message_id_name(enum mtc_message_id value);
 const char *mtc_modem_state_name(enum mtc_modem_state value);
+const char *mce_rf_state_name(enum mce_rf_state value);
+
+const char *mce_message_id_name(enum mce_message_id value);
+const char *mce_modem_state_name(enum mce_modem_state value);
+const char *mce_status_info(enum mce_status_info value);
+
+const char *uicc_subblock_name(uint8_t value);
+const char *uicc_status_name(uint8_t value);
 
 const char *sms_gsm_cause_name(enum sms_gsm_cause value);
 const char *sms_isi_cause_name(enum sms_isi_cause value);
diff --git a/drivers/isimodem/mtc.h b/drivers/isimodem/mtc.h
index 2db3e94..57e5040 100644
--- a/drivers/isimodem/mtc.h
+++ b/drivers/isimodem/mtc.h
@@ -27,9 +27,47 @@ extern "C" {
 #endif
 
 #define PN_MTC				0x15
+#define PN_MODEM_MCE			0xC2
 #define MTC_TIMEOUT			5
 #define MTC_STATE_REQ_TIMEOUT		(6 + 5)
 
+enum mce_message_id {
+	MCE_MODEM_STATE_IND =		0x00,
+	MCE_MODEM_STATE_QUERY_REQ =     0x01,
+	MCE_MODEM_STATE_QUERY_RESP =    0x02,
+	MCE_RF_STATE_REQ =		0x03,
+	MCE_RF_STATE_RESP =		0x04,
+	MCE_RF_STATE_IND =		0x05,
+	MCE_RF_STATE_QUERY_REQ =	0x06,
+	MCE_RF_STATE_QUERY_RESP =       0x07,
+	MCE_POWER_OFF_REQ =		0x08,
+	MCE_POWER_OFF_RESP =		0x09
+};
+
+enum mce_rf_state {
+	MCE_RF_OFF =			0x00,
+	MCE_RF_ON =			0x01
+};
+
+enum mce_status_info {
+	MCE_OK =			0x00,
+	MCE_FAIL =			0x01,
+	MCE_ALREADY_ACTIVE =		0x06,
+	MCE_TRANSITION_ONGOING =	0x16
+};
+
+enum mce_modem_state {
+	MCE_NORMAL =			0x00,
+	MCE_LOCAL =			0x01,
+	MCE_SW_RESET =			0x80,
+	MCE_POWER_OFF =			0x81
+};
+
+enum mce_isi_action {
+	MCE_START =			0x03,
+	MCE_READY =			0x04
+};
+
 enum mtc_isi_cause {
 	MTC_OK =			0x00,
 	MTC_FAIL =			0x01,
diff --git a/drivers/isimodem/version.h b/drivers/isimodem/version.h
new file mode 100644
index 0000000..9b0a993
--- /dev/null
+++ b/drivers/isimodem/version.h
@@ -0,0 +1,26 @@
+
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) ST-Ericsson SA 2011.
+ *
+ *  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
+ *
+ */
+
+enum isi_version {
+	ISI_20 = 0,
+	ISI_25 = 1
+};
-- 
1.7.3.5


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 2/3] udev: u8500 support and style fix
  2011-02-01 14:13 ` [PATCH v2 2/3] udev: u8500 support and style fix Jessica Nilsson
@ 2011-02-01 15:39   ` Marcel Holtmann
  2011-02-01 15:55     ` Andreas WESTIN
  0 siblings, 1 reply; 17+ messages in thread
From: Marcel Holtmann @ 2011-02-01 15:39 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]

Hi Jessica,

>  plugins/udev.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)

so you wanna combine the udev rule change and the udev change together
actually. They both belong together. The actual modem plugin driver is
not related.

> diff --git a/plugins/udev.c b/plugins/udev.c
> index ce1efe6..49b5eb8 100644
> --- a/plugins/udev.c
> +++ b/plugins/udev.c
> @@ -185,7 +185,8 @@ static void add_hso(struct ofono_modem *modem,
>  		devnode = udev_device_get_devnode(udev_device);
>  
>  		if (g_str_has_suffix(type, "Application") == TRUE)
> -			ofono_modem_set_string(modem, APPLICATION_PORT, devnode);
> +			ofono_modem_set_string(modem, APPLICATION_PORT,
> +						devnode);

What is this part doing here?

>  		else if (g_str_has_suffix(type, "Control") == TRUE)
>  			ofono_modem_set_string(modem, CONTROL_PORT, devnode);
>  	} else if (g_str_equal(subsystem, "net") == TRUE) {
> @@ -636,6 +637,8 @@ done:
>  		add_nokia(modem, udev_device);
>  	else if (g_strcmp0(driver, "isiusb") == 0)
>  		add_isi(modem, udev_device);
> +	else if (g_strcmp0(driver, "u8500") == 0)
> +		add_isi(modem, udev_device);
>  	else if (g_strcmp0(driver, "n900") == 0)
>  		add_isi(modem, udev_device);
>  	else if (g_strcmp0(driver, "gobi") == 0)

Regards

Marcel



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 1/3] u8500: add plugin for u8500
  2011-02-01 14:13 ` [PATCH v2 1/3] u8500: add plugin for u8500 Jessica Nilsson
@ 2011-02-01 15:41   ` Marcel Holtmann
  0 siblings, 0 replies; 17+ messages in thread
From: Marcel Holtmann @ 2011-02-01 15:41 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]

Hi Jessica,

>  Makefile.am         |    4 +
>  plugins/ofono.rules |    3 +
>  plugins/u8500.c     |  507 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 514 insertions(+), 0 deletions(-)
>  create mode 100644 plugins/u8500.c

as mentioned in the other email. Put ofono.rules and udev.c changes into
one patch.

> diff --git a/Makefile.am b/Makefile.am
> index a38fcb9..4762cc8 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -110,6 +110,7 @@ builtin_sources += $(gisi_sources) \
>  				drivers/isimodem/mtc.h \
>  				drivers/isimodem/debug.h \
>  				drivers/isimodem/isiutil.h \
> +				drivers/isimodem/version.h \
>  				drivers/isimodem/debug.c \
>  				drivers/isimodem/phonebook.c \
>  				drivers/isimodem/devinfo.c \

This does not belong here. Please be careful what is in your patches.

> @@ -144,6 +145,9 @@ builtin_sources += plugins/isiusb.c
>  
>  builtin_modules += n900
>  builtin_sources += plugins/n900.c plugins/nokia-gpio.h plugins/nokia-gpio.c
> +
> +builtin_modules += u8500
> +builtin_sources += plugins/u8500.c
>  endif
>  
>  if ATMODEM
> diff --git a/plugins/ofono.rules b/plugins/ofono.rules
> index 111f071..333bff0 100644
> --- a/plugins/ofono.rules
> +++ b/plugins/ofono.rules
> @@ -356,6 +356,9 @@ SUBSYSTEMS=="usb", ENV{OFONO_DRIVER}="isiusb", ENV{OFONO_ISI_ADDRESS}="16"
>  # Nokia N900 modem
>  SUBSYSTEMS=="hsi", ENV{OFONO_DRIVER}="n900", ENV{OFONO_ISI_ADDRESS}="108"
>  
> +# STE u8500
> +KERNEL=="shrm0", ENV{OFONO_DRIVER}="u8500"
> +
>  LABEL="ofono_isi_end"
>  
>  SUBSYSTEM!="usb", GOTO="ofono_end"

Regards

Marcel



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-01 14:13 ` [PATCH v2 3/3] isimodem: header updates for ISI2.5 Jessica Nilsson
@ 2011-02-01 15:43   ` Marcel Holtmann
  2011-02-01 16:29     ` Andreas WESTIN
  2011-02-01 19:32     ` Aki Niemi
  0 siblings, 2 replies; 17+ messages in thread
From: Marcel Holtmann @ 2011-02-01 15:43 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

Hi Jessica,

>  drivers/isimodem/debug.c   |  132 ++++++++++++++++++++++++++++++++++++++++++++
>  drivers/isimodem/debug.h   |    9 +++
>  drivers/isimodem/mtc.h     |   38 +++++++++++++
>  drivers/isimodem/version.h |   26 +++++++++
>  4 files changed, 205 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/isimodem/version.h

<snip>

> +enum isi_version {
> +	ISI_20 = 0,
> +	ISI_25 = 1
> +};

so what is the final decision here now. ISI doing auto-detection and
this gets not exposed to the modem drivers or we do.

Aki, I remember you saying that this is not needed at all.

Regards

Marcel



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 2/3] udev: u8500 support and style fix
  2011-02-01 15:39   ` Marcel Holtmann
@ 2011-02-01 15:55     ` Andreas WESTIN
  2011-02-01 16:12       ` Marcel Holtmann
  0 siblings, 1 reply; 17+ messages in thread
From: Andreas WESTIN @ 2011-02-01 15:55 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]

Hi Marcel,

Jessica is out of office.

On 2011-02-01 16:39, Marcel Holtmann wrote:
> Hi Jessica,
>
>>   plugins/udev.c |    5 ++++-
>>   1 files changed, 4 insertions(+), 1 deletions(-)
>
> so you wanna combine the udev rule change and the udev change together
> actually. They both belong together. The actual modem plugin driver is
> not related.

Ok, will correct.

>> diff --git a/plugins/udev.c b/plugins/udev.c
>> index ce1efe6..49b5eb8 100644
>> --- a/plugins/udev.c
>> +++ b/plugins/udev.c
>> @@ -185,7 +185,8 @@ static void add_hso(struct ofono_modem *modem,
>>   		devnode = udev_device_get_devnode(udev_device);
>>
>>   		if (g_str_has_suffix(type, "Application") == TRUE)
>> -			ofono_modem_set_string(modem, APPLICATION_PORT, devnode);
>> +			ofono_modem_set_string(modem, APPLICATION_PORT,
>> +						devnode);
>
> What is this part doing here?

Style fix, should it be removed ?

>>   		else if (g_str_has_suffix(type, "Control") == TRUE)
>>   			ofono_modem_set_string(modem, CONTROL_PORT, devnode);
>>   	} else if (g_str_equal(subsystem, "net") == TRUE) {
>> @@ -636,6 +637,8 @@ done:
>>   		add_nokia(modem, udev_device);
>>   	else if (g_strcmp0(driver, "isiusb") == 0)
>>   		add_isi(modem, udev_device);
>> +	else if (g_strcmp0(driver, "u8500") == 0)
>> +		add_isi(modem, udev_device);
>>   	else if (g_strcmp0(driver, "n900") == 0)
>>   		add_isi(modem, udev_device);
>>   	else if (g_strcmp0(driver, "gobi") == 0)
>

Regards
Andreas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 2/3] udev: u8500 support and style fix
  2011-02-01 15:55     ` Andreas WESTIN
@ 2011-02-01 16:12       ` Marcel Holtmann
  0 siblings, 0 replies; 17+ messages in thread
From: Marcel Holtmann @ 2011-02-01 16:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 727 bytes --]

Hi Andreas,

> >> diff --git a/plugins/udev.c b/plugins/udev.c
> >> index ce1efe6..49b5eb8 100644
> >> --- a/plugins/udev.c
> >> +++ b/plugins/udev.c
> >> @@ -185,7 +185,8 @@ static void add_hso(struct ofono_modem *modem,
> >>   		devnode = udev_device_get_devnode(udev_device);
> >>
> >>   		if (g_str_has_suffix(type, "Application") == TRUE)
> >> -			ofono_modem_set_string(modem, APPLICATION_PORT, devnode);
> >> +			ofono_modem_set_string(modem, APPLICATION_PORT,
> >> +						devnode);
> >
> > What is this part doing here?
> 
> Style fix, should it be removed ?

style fixes should always be a separate patch. Do not intermix totally
unrelated style fixes with actual changes.

Regards

Marcel



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-01 15:43   ` Marcel Holtmann
@ 2011-02-01 16:29     ` Andreas WESTIN
  2011-02-01 19:32     ` Aki Niemi
  1 sibling, 0 replies; 17+ messages in thread
From: Andreas WESTIN @ 2011-02-01 16:29 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

Hi Marcel,

On 2011-02-01 16:43, Marcel Holtmann wrote:
> Hi Jessica,
>
>>   drivers/isimodem/debug.c   |  132 ++++++++++++++++++++++++++++++++++++++++++++
>>   drivers/isimodem/debug.h   |    9 +++
>>   drivers/isimodem/mtc.h     |   38 +++++++++++++
>>   drivers/isimodem/version.h |   26 +++++++++
>>   4 files changed, 205 insertions(+), 0 deletions(-)
>>   create mode 100644 drivers/isimodem/version.h
>
> <snip>
>
>> +enum isi_version {
>> +	ISI_20 = 0,
>> +	ISI_25 = 1
>> +};
>
> so what is the final decision here now. ISI doing auto-detection and
> this gets not exposed to the modem drivers or we do.
>
> Aki, I remember you saying that this is not needed at all.
>

We need to know which version of ISI we are using in the driver, 
messages differ. But we are open to other suggestions.

Marcel, as to your other comments we will correct them and send new patches.

Regards
Andreas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-01 15:43   ` Marcel Holtmann
  2011-02-01 16:29     ` Andreas WESTIN
@ 2011-02-01 19:32     ` Aki Niemi
  2011-02-02  9:03       ` Andreas WESTIN
                         ` (2 more replies)
  1 sibling, 3 replies; 17+ messages in thread
From: Aki Niemi @ 2011-02-01 19:32 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

Hi Marcel,

On Tue, 2011-02-01 at 16:43 +0100, ext Marcel Holtmann wrote:
> > +enum isi_version {
> > +	ISI_20 = 0,
> > +	ISI_25 = 1
> > +};
> 
> so what is the final decision here now. ISI doing auto-detection and
> this gets not exposed to the modem drivers or we do.

Like I replied earlier, I don't see the need for this. Also, it will not
work well with the isiusb plugin, which has the potential to work with
any ISI modem. I'm not willing to break that potential until we just
absolutely have to.

So, my stance holds: we quirk based on resource ID and based on the
server's ISI version.

I'm starting to think me just saying this out loud is not concrete
enough, so I guess one way forward here could be for me to go ahead and
adapt e.g. the netreg driver to work with N900 and later ISI modems. The
netreg driver would make a good example, as it is one of those where the
resource ID changes post N900, and the messages do vary based on it.

Cheers,
Aki


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-01 19:32     ` Aki Niemi
@ 2011-02-02  9:03       ` Andreas WESTIN
  2011-02-02 13:03         ` Aki Niemi
  2011-02-02 10:47       ` Marcel Holtmann
  2011-02-08 15:16       ` Aki Niemi
  2 siblings, 1 reply; 17+ messages in thread
From: Andreas WESTIN @ 2011-02-02  9:03 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 663 bytes --]

Hi Aki,

On 2011-02-01 20:32, Aki Niemi wrote:
> Like I replied earlier, I don't see the need for this. Also, it will not
> work well with the isiusb plugin, which has the potential to work with
> any ISI modem. I'm not willing to break that potential until we just
> absolutely have to.

U8500 uses shrm driver and will not be recognized via isiusb.

> So, my stance holds: we quirk based on resource ID and based on the
> server's ISI version.

 From the information we have regarding ISI version from each server is 
that it is not consistent, meaning the value you get is not really the 
ISI version but the version of the server.

/Andreas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-01 19:32     ` Aki Niemi
  2011-02-02  9:03       ` Andreas WESTIN
@ 2011-02-02 10:47       ` Marcel Holtmann
  2011-02-08 15:16       ` Aki Niemi
  2 siblings, 0 replies; 17+ messages in thread
From: Marcel Holtmann @ 2011-02-02 10:47 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]

Hi Aki,

> > > +enum isi_version {
> > > +	ISI_20 = 0,
> > > +	ISI_25 = 1
> > > +};
> > 
> > so what is the final decision here now. ISI doing auto-detection and
> > this gets not exposed to the modem drivers or we do.
> 
> Like I replied earlier, I don't see the need for this. Also, it will not
> work well with the isiusb plugin, which has the potential to work with
> any ISI modem. I'm not willing to break that potential until we just
> absolutely have to.
> 
> So, my stance holds: we quirk based on resource ID and based on the
> server's ISI version.

good to know. I was just double-checking in case you guys agreed on
something different on a private channel.

> I'm starting to think me just saying this out loud is not concrete
> enough, so I guess one way forward here could be for me to go ahead and
> adapt e.g. the netreg driver to work with N900 and later ISI modems. The
> netreg driver would make a good example, as it is one of those where the
> resource ID changes post N900, and the messages do vary based on it.

I think having an example on how you want this handled would be a good
idea. I don't have time to get myself familiar enough with ISI that I
can do any proper review here. So this is in your hands.

Regards

Marcel



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-02  9:03       ` Andreas WESTIN
@ 2011-02-02 13:03         ` Aki Niemi
  2011-02-03  9:32           ` Andreas WESTIN
  0 siblings, 1 reply; 17+ messages in thread
From: Aki Niemi @ 2011-02-02 13:03 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

On Wed, 2011-02-02 at 10:03 +0100, ext Andreas WESTIN wrote:
> On 2011-02-01 20:32, Aki Niemi wrote:
> > Like I replied earlier, I don't see the need for this. Also, it will not
> > work well with the isiusb plugin, which has the potential to work with
> > any ISI modem. I'm not willing to break that potential until we just
> > absolutely have to.
> 
> U8500 uses shrm driver and will not be recognized via isiusb.

I don't see what that has to do with the device supporting the "PC
suite" USB profile, which allows modem access using cdc_phonet.

> > So, my stance holds: we quirk based on resource ID and based on the
> > server's ISI version.
> 
>  From the information we have regarding ISI version from each server is 
> that it is not consistent, meaning the value you get is not really the 
> ISI version but the version of the server.

That is exactly what I meant. This version allows building quirks inside
the drivers. An example in pseudo-code:

if GIsiVersion.major == 15 and GIsiVersion.minor >= 3:
	send( { FOO, value, filler, filler}, callback1 )
else:
	send( { FOO, value }, callback2 )

Cheers,
Aki


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-02 13:03         ` Aki Niemi
@ 2011-02-03  9:32           ` Andreas WESTIN
  2011-02-04  9:05             ` Aki Niemi
  0 siblings, 1 reply; 17+ messages in thread
From: Andreas WESTIN @ 2011-02-03  9:32 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

Hi Aki,

On 2011-02-02 14:03, Aki Niemi wrote:
> I don't see what that has to do with the device supporting the "PC
> suite" USB profile, which allows modem access using cdc_phonet.

Currently our platform does not support this.

> That is exactly what I meant. This version allows building quirks inside
> the drivers. An example in pseudo-code:
>
> if GIsiVersion.major == 15 and GIsiVersion.minor>= 3:
> 	send( { FOO, value, filler, filler}, callback1 )
> else:
> 	send( { FOO, value }, callback2 )
>

Yes, we use a similar solution in gisi, but Rémi pointed out that it 
would be a maintenance problem once there are more versions to support 
and I tend to agree. A solution could be to use a lookup function, but 
this function would need to return something to compare with, an enum 
perhaps.
Also are you certain that e.g major == 15 and minor == 25 is still the 
same ISI version, if not then the lookup function could become messy.

Regards
Andreas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-03  9:32           ` Andreas WESTIN
@ 2011-02-04  9:05             ` Aki Niemi
  0 siblings, 0 replies; 17+ messages in thread
From: Aki Niemi @ 2011-02-04  9:05 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

Hi Andreas,

2011/2/3 Andreas WESTIN <andreas.westin@stericsson.com>:
>> I don't see what that has to do with the device supporting the "PC
>> suite" USB profile, which allows modem access using cdc_phonet.
>
> Currently our platform does not support this.

Well, I know of platforms that do, and have different versions of ISI modems.

>> That is exactly what I meant. This version allows building quirks inside
>> the drivers. An example in pseudo-code:
>>
>> if GIsiVersion.major == 15 and GIsiVersion.minor>= 3:
>>        send( { FOO, value, filler, filler}, callback1 )
>> else:
>>        send( { FOO, value }, callback2 )
>>
>
> Yes, we use a similar solution in gisi, but Rémi pointed out that it would
> be a maintenance problem once there are more versions to support and I tend
> to agree. A solution could be to use a lookup function, but this function
> would need to return something to compare with, an enum perhaps.
> Also are you certain that e.g major == 15 and minor == 25 is still the same
> ISI version, if not then the lookup function could become messy.

The PNS_SUBSCRIBED_RESOURCES_EXTEND_IND is a bit of a special case, as
it requires quirking inside GIsiModem. But see my other response in
that thread.

Cheers,
Aki

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/3] isimodem: header updates for ISI2.5
  2011-02-01 19:32     ` Aki Niemi
  2011-02-02  9:03       ` Andreas WESTIN
  2011-02-02 10:47       ` Marcel Holtmann
@ 2011-02-08 15:16       ` Aki Niemi
  2 siblings, 0 replies; 17+ messages in thread
From: Aki Niemi @ 2011-02-08 15:16 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

Hi,

2011/2/1 Aki Niemi <aki.niemi@nokia.com>:
> I'm starting to think me just saying this out loud is not concrete
> enough, so I guess one way forward here could be for me to go ahead and
> adapt e.g. the netreg driver to work with N900 and later ISI modems. The
> netreg driver would make a good example, as it is one of those where the
> resource ID changes post N900, and the messages do vary based on it.

I went ahead and pushed some patches refactoring the isimodem netreg
driver to work with both the old modem API as well as the new wgmodem
2.5 version.

Please take a look if it works for you.

Cheers,
Aki

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-02-08 15:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 14:13 [PATCH v2 0/3] ISI modem version detection with plugin Jessica Nilsson
2011-02-01 14:13 ` [PATCH v2 1/3] u8500: add plugin for u8500 Jessica Nilsson
2011-02-01 15:41   ` Marcel Holtmann
2011-02-01 14:13 ` [PATCH v2 2/3] udev: u8500 support and style fix Jessica Nilsson
2011-02-01 15:39   ` Marcel Holtmann
2011-02-01 15:55     ` Andreas WESTIN
2011-02-01 16:12       ` Marcel Holtmann
2011-02-01 14:13 ` [PATCH v2 3/3] isimodem: header updates for ISI2.5 Jessica Nilsson
2011-02-01 15:43   ` Marcel Holtmann
2011-02-01 16:29     ` Andreas WESTIN
2011-02-01 19:32     ` Aki Niemi
2011-02-02  9:03       ` Andreas WESTIN
2011-02-02 13:03         ` Aki Niemi
2011-02-03  9:32           ` Andreas WESTIN
2011-02-04  9:05             ` Aki Niemi
2011-02-02 10:47       ` Marcel Holtmann
2011-02-08 15:16       ` Aki Niemi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.