* Re: [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port
2011-12-08 14:49 ` [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port Philippe Nunes
@ 2011-12-08 14:13 ` Marcel Holtmann
2011-12-08 16:07 ` Philippe Nunes
2011-12-09 12:09 ` Denis Kenzior
1 sibling, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2011-12-08 14:13 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
Hi Philippe,
> gatchat/gatchat.c | 26 ++++++++++++++++++++++++++
> gatchat/gatchat.h | 4 ++++
> 2 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
> index 7a0ef35..00e5fa8 100644
> --- a/gatchat/gatchat.c
> +++ b/gatchat/gatchat.c
> @@ -35,6 +35,7 @@
> #include "ringbuffer.h"
> #include "gatchat.h"
> #include "gatio.h"
> +#include "gathdlc.h"
>
> /* #define WRITE_SCHEDULER_DEBUG 1 */
>
> @@ -110,6 +111,7 @@ struct _GAtChat {
> struct at_chat *parent;
> guint group;
> GAtChat *slave;
> + GAtHDLC *diag_monitor;
> };
what is this for? I don't see this needed at all. You are not crossing
atom driver implementations anyway.
Regards
Marcel
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 00/12] Provider name and SID
@ 2011-12-08 14:49 Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 01/12] cdma-providers: add driver APIs header Philippe Nunes
` (11 more replies)
0 siblings, 12 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2188 bytes --]
Hi,
change log from previous version:
- Fix the copyrigths.
- Add Qualcomm Diagnostic Monitor port support to get the SID with the command
'station status'. This diagnostic port is especially needed in case of EV-DO
capable hardware for which the AT command AT+CSS? may not return a valid answer.
- Assign by default the huawei QCDM port to the second interface (this rule is
issued from a practical observation)
- Fix the 'sysinfo' parsing. When the service domain is set to 'CDMA not supported'
with EV-DO capable hardware, it doesn't mean that the network is not registered.
Regards,
Philippe.
Philippe Nunes (12):
cdma-providers: add driver APIs header
ofono.h: add cdma-providers
cdma-providers: add driver APIs implementation
providers: Add cdma provider name plugin
cdma-netreg: Add provider name and SID support
gatchat: Add possibility to associate a diagnostic monitor to the
AT-capable port
huaweicdma: Use pcui port for cdma_netreg
huaweicdma: Open qcdm port to be used for signal quality or network
status
huaweicdmamodem: Probe the QCDM port with the version info request
huaweicdmamodem: Add 'serving_system' entry point to get SID
udevng: Add a default assignment for Huawei QCDM port
huaweicdmamodem: Fix sysinfo parsing
Makefile.am | 4 +-
drivers/huaweicdmamodem/network-registration.c | 247 ++++++++++++++++++++++-
gatchat/gatchat.c | 26 +++
gatchat/gatchat.h | 4 +
include/cdma-providers.h | 44 +++++
plugins/huaweicdma.c | 46 +++++-
plugins/providers.c | 79 ++++++++
plugins/udevng.c | 30 ++-
src/cdma-netreg.c | 40 ++++
src/cdma-providers.c | 80 ++++++++
src/ofono.h | 4 +
11 files changed, 581 insertions(+), 23 deletions(-)
create mode 100644 include/cdma-providers.h
create mode 100644 plugins/providers.c
create mode 100644 src/cdma-providers.c
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 01/12] cdma-providers: add driver APIs header
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
@ 2011-12-08 14:49 ` Philippe Nunes
2011-12-09 11:50 ` Denis Kenzior
2011-12-08 14:49 ` [PATCH v2 02/12] ofono.h: add cdma-providers Philippe Nunes
` (10 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]
---
include/cdma-providers.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
create mode 100644 include/cdma-providers.h
diff --git a/include/cdma-providers.h b/include/cdma-providers.h
new file mode 100644
index 0000000..6878087
--- /dev/null
+++ b/include/cdma-providers.h
@@ -0,0 +1,44 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2011 Intel 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 __OFONO_CDMA_PROVIDERS_H
+#define __OFONO_CDMA_PROVIDERS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ofono_cdma_providers_driver {
+ const char *name;
+ int priority;
+ int (*get_provider_name)(const char *sid, char **name);
+};
+
+int ofono_cdma_providers_driver_register(
+ const struct ofono_cdma_providers_driver *driver);
+void ofono_cdma_providers_driver_unregister(
+ const struct ofono_cdma_providers_driver *driver);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __OFONO_CDMA_PROVIDERS_H */
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 02/12] ofono.h: add cdma-providers
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 01/12] cdma-providers: add driver APIs header Philippe Nunes
@ 2011-12-08 14:49 ` Philippe Nunes
2011-12-09 11:52 ` Denis Kenzior
2011-12-08 14:49 ` [PATCH v2 03/12] cdma-providers: add driver APIs implementation Philippe Nunes
` (9 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
---
src/ofono.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/ofono.h b/src/ofono.h
index bfb534d..a26c06d 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -487,6 +487,10 @@ void __ofono_gprs_provision_free_settings(
#include <ofono/gnss.h>
#include <ofono/cdma-sms.h>
#include <ofono/cdma-netreg.h>
+
+#include <ofono/cdma-providers.h>
+ofono_bool_t __ofono_cdma_providers_get_name(const char *sid, char **name);
+
#include <ofono/private-network.h>
void __ofono_private_network_release(int id);
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 03/12] cdma-providers: add driver APIs implementation
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 01/12] cdma-providers: add driver APIs header Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 02/12] ofono.h: add cdma-providers Philippe Nunes
@ 2011-12-08 14:49 ` Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 04/12] providers: Add cdma provider name plugin Philippe Nunes
` (8 subsequent siblings)
11 siblings, 0 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3473 bytes --]
---
Makefile.am | 4 +-
src/cdma-providers.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 2 deletions(-)
create mode 100644 src/cdma-providers.c
diff --git a/Makefile.am b/Makefile.am
index 337aeb7..dca9984 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@ pkginclude_HEADERS = include/log.h include/plugin.h include/history.h \
include/location-reporting.h \
include/cdma-connman.h include/gnss.h \
include/private-network.h include/cdma-netreg.h \
- include/handsfree.h
+ include/cdma-providers.h include/handsfree.h
nodist_pkginclude_HEADERS = include/version.h
@@ -430,7 +430,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) src/ofono.ver \
src/gnssagent.c src/gnssagent.h \
src/cdma-smsutil.h src/cdma-smsutil.c \
src/cdma-sms.c src/private-network.c src/cdma-netreg.c \
- src/handsfree.c
+ src/cdma-providers.c src/handsfree.c
src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ -ldl
diff --git a/src/cdma-providers.c b/src/cdma-providers.c
new file mode 100644
index 0000000..924ad55
--- /dev/null
+++ b/src/cdma-providers.c
@@ -0,0 +1,80 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2011 Intel 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 <string.h>
+#include <glib.h>
+#include "ofono.h"
+
+static GSList *g_drivers = NULL;
+
+ofono_bool_t __ofono_cdma_providers_get_name(const char *sid, char **name)
+{
+ GSList *d;
+
+ if (sid == NULL || strlen(sid) == 0)
+ return FALSE;
+
+ for (d = g_drivers; d != NULL; d = d->next) {
+ const struct ofono_cdma_providers_driver *driver = d->data;
+
+ if (driver->get_provider_name == NULL)
+ continue;
+
+ DBG("Calling providers plugin '%s'", driver->name);
+
+ if (driver->get_provider_name(sid, name) < 0)
+ continue;
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static gint compare_priority(gconstpointer a, gconstpointer b)
+{
+ const struct ofono_cdma_providers_driver *plugin1 = a;
+ const struct ofono_cdma_providers_driver *plugin2 = b;
+
+ return plugin2->priority - plugin1->priority;
+}
+
+int ofono_cdma_providers_driver_register(
+ const struct ofono_cdma_providers_driver *driver)
+{
+ DBG("driver: %p name: %s", driver, driver->name);
+
+ g_drivers = g_slist_insert_sorted(g_drivers, (void *) driver,
+ compare_priority);
+ return 0;
+}
+
+void ofono_cdma_providers_driver_unregister(
+ const struct ofono_cdma_providers_driver *driver)
+{
+ DBG("driver: %p name: %s", driver, driver->name);
+
+ g_drivers = g_slist_remove(g_drivers, driver);
+}
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 04/12] providers: Add cdma provider name plugin
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (2 preceding siblings ...)
2011-12-08 14:49 ` [PATCH v2 03/12] cdma-providers: add driver APIs implementation Philippe Nunes
@ 2011-12-08 14:49 ` Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 05/12] cdma-netreg: Add provider name and SID support Philippe Nunes
` (7 subsequent siblings)
11 siblings, 0 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2477 bytes --]
---
plugins/providers.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 79 insertions(+), 0 deletions(-)
create mode 100644 plugins/providers.c
diff --git a/plugins/providers.c b/plugins/providers.c
new file mode 100644
index 0000000..f267db9
--- /dev/null
+++ b/plugins/providers.c
@@ -0,0 +1,79 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2011 Intel 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 <errno.h>
+#include <string.h>
+
+#include <glib.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/types.h>
+#include <ofono/log.h>
+#include <ofono/plugin.h>
+#include <ofono/modem.h>
+#include <ofono/gprs-provision.h>
+#include <ofono/cdma-providers.h>
+
+#include "mbpi.h"
+
+static int providers_get_name(const char *sid, char **name)
+{
+ GError *error = NULL;
+
+ DBG("Search provider name for SID %s", sid);
+
+ *name = mbpi_lookup_cdma_provider_name(sid, &error);
+ if (*name == NULL) {
+ if (error != NULL) {
+ ofono_error("%s", error->message);
+ g_error_free(error);
+ }
+
+ return -ENOENT;
+ }
+
+ DBG("Found provider name: %s", *name);
+
+ return 0;
+}
+
+static struct ofono_cdma_providers_driver providers_driver = {
+ .name = "Mobile providers",
+ .get_provider_name = providers_get_name
+};
+
+static int providers_init(void)
+{
+ return ofono_cdma_providers_driver_register(&providers_driver);
+}
+
+static void providers_exit(void)
+{
+ ofono_cdma_providers_driver_unregister(&providers_driver);
+}
+
+OFONO_PLUGIN_DEFINE(providers, "Mobile providers Plugin", VERSION,
+ OFONO_PLUGIN_PRIORITY_DEFAULT,
+ providers_init, providers_exit)
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 05/12] cdma-netreg: Add provider name and SID support
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (3 preceding siblings ...)
2011-12-08 14:49 ` [PATCH v2 04/12] providers: Add cdma provider name plugin Philippe Nunes
@ 2011-12-08 14:49 ` Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port Philippe Nunes
` (6 subsequent siblings)
11 siblings, 0 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2748 bytes --]
---
src/cdma-netreg.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/src/cdma-netreg.c b/src/cdma-netreg.c
index 222c3b7..eaa4524 100644
--- a/src/cdma-netreg.c
+++ b/src/cdma-netreg.c
@@ -24,6 +24,7 @@
#endif
#include <errno.h>
+#include <string.h>
#include <gdbus.h>
@@ -38,6 +39,8 @@ struct ofono_cdma_netreg {
const struct ofono_cdma_netreg_driver *driver;
void *driver_data;
struct ofono_atom *atom;
+ char *provider_name;
+ char *sid;
};
static const char *cdma_netreg_status_to_string(enum cdma_netreg_status status)
@@ -90,6 +93,15 @@ static DBusMessage *network_get_properties(DBusConnection *conn,
&strength);
}
+ if (cdma_netreg->sid)
+ ofono_dbus_dict_append(&dict, "SystemIdentifier",
+ DBUS_TYPE_STRING,
+ &cdma_netreg->sid);
+
+ if (cdma_netreg->provider_name)
+ ofono_dbus_dict_append(&dict, "Name", DBUS_TYPE_STRING,
+ &cdma_netreg->provider_name);
+
dbus_message_iter_close_container(&iter, &dict);
return reply;
@@ -108,6 +120,8 @@ static void serving_system_callback(const struct ofono_error *error,
const char *sid, void *data)
{
struct ofono_cdma_netreg *cdma_netreg = data;
+ const char *path = __ofono_atom_get_path(cdma_netreg->atom);
+ DBusConnection *conn = ofono_dbus_get_connection();
if (cdma_netreg->status != CDMA_NETWORK_REGISTRATION_STATUS_REGISTERED
&& cdma_netreg->status !=
@@ -120,6 +134,30 @@ static void serving_system_callback(const struct ofono_error *error,
}
DBG("Serving system Identifier: %s", sid);
+
+ if (cdma_netreg->sid != NULL && !strcmp(cdma_netreg->sid, sid))
+ return;
+
+ g_free(cdma_netreg->provider_name);
+ g_free(cdma_netreg->sid);
+ cdma_netreg->provider_name = NULL;
+ cdma_netreg->sid = g_strdup(sid);
+
+ ofono_dbus_signal_property_changed(conn, path,
+ OFONO_CDMA_NETWORK_REGISTRATION_INTERFACE,
+ "SystemIdentifier", DBUS_TYPE_STRING,
+ &cdma_netreg->sid);
+
+ if (__ofono_cdma_providers_get_name(sid,
+ &cdma_netreg->provider_name) == FALSE) {
+ ofono_warn("Provider name not found");
+ return;
+ }
+
+ ofono_dbus_signal_property_changed(conn, path,
+ OFONO_CDMA_NETWORK_REGISTRATION_INTERFACE,
+ "Name", DBUS_TYPE_STRING,
+ &cdma_netreg->provider_name);
}
static void set_registration_status(struct ofono_cdma_netreg *cdma_netreg,
@@ -251,6 +289,8 @@ static void cdma_netreg_remove(struct ofono_atom *atom)
if (cdma_netreg->driver && cdma_netreg->driver->remove)
cdma_netreg->driver->remove(cdma_netreg);
+ g_free(cdma_netreg->sid);
+ g_free(cdma_netreg->provider_name);
g_free(cdma_netreg);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (4 preceding siblings ...)
2011-12-08 14:49 ` [PATCH v2 05/12] cdma-netreg: Add provider name and SID support Philippe Nunes
@ 2011-12-08 14:49 ` Philippe Nunes
2011-12-08 14:13 ` Marcel Holtmann
2011-12-09 12:09 ` Denis Kenzior
2011-12-08 14:49 ` [PATCH v2 07/12] huaweicdma: Use pcui port for cdma_netreg Philippe Nunes
` (5 subsequent siblings)
11 siblings, 2 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1964 bytes --]
---
gatchat/gatchat.c | 26 ++++++++++++++++++++++++++
gatchat/gatchat.h | 4 ++++
2 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index 7a0ef35..00e5fa8 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -35,6 +35,7 @@
#include "ringbuffer.h"
#include "gatchat.h"
#include "gatio.h"
+#include "gathdlc.h"
/* #define WRITE_SCHEDULER_DEBUG 1 */
@@ -110,6 +111,7 @@ struct _GAtChat {
struct at_chat *parent;
guint group;
GAtChat *slave;
+ GAtHDLC *diag_monitor;
};
struct terminator_info {
@@ -1354,6 +1356,30 @@ GAtChat *g_at_chat_get_slave(GAtChat *chat)
return chat->slave;
}
+GAtHDLC *g_at_chat_associate_diag_monitor(GAtChat *chat, GAtHDLC *diag)
+{
+ if (chat == NULL)
+ return NULL;
+
+ if (chat->diag_monitor != NULL)
+ g_at_hdlc_unref(chat->diag_monitor);
+
+ if (diag != NULL)
+ chat->diag_monitor = g_at_hdlc_ref(diag);
+ else
+ chat->diag_monitor = NULL;
+
+ return chat->diag_monitor;
+}
+
+GAtHDLC *g_at_chat_get_diag_monitor(GAtChat *chat)
+{
+ if (chat == NULL)
+ return NULL;
+
+ return chat->diag_monitor;
+}
+
GIOChannel *g_at_chat_get_channel(GAtChat *chat)
{
if (chat == NULL || chat->parent->io == NULL)
diff --git a/gatchat/gatchat.h b/gatchat/gatchat.h
index 367581e..d8863b8 100644
--- a/gatchat/gatchat.h
+++ b/gatchat/gatchat.h
@@ -30,6 +30,7 @@ extern "C" {
#include "gatsyntax.h"
#include "gatutil.h"
#include "gatio.h"
+#include "gathdlc.h"
struct _GAtChat;
@@ -68,6 +69,9 @@ GAtChat *g_at_chat_clone(GAtChat *chat);
GAtChat *g_at_chat_set_slave(GAtChat *chat, GAtChat *slave);
GAtChat *g_at_chat_get_slave(GAtChat *chat);
+GAtHDLC *g_at_chat_associate_diag_monitor(GAtChat *chat, GAtHDLC *diag);
+GAtHDLC *g_at_chat_get_diag_monitor(GAtChat *chat);
+
void g_at_chat_suspend(GAtChat *chat);
void g_at_chat_resume(GAtChat *chat);
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 07/12] huaweicdma: Use pcui port for cdma_netreg
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (5 preceding siblings ...)
2011-12-08 14:49 ` [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port Philippe Nunes
@ 2011-12-08 14:49 ` Philippe Nunes
2011-12-09 12:11 ` Denis Kenzior
2011-12-08 14:49 ` [PATCH v2 08/12] huaweicdma: Open qcdm port to be used for signal quality or network status Philippe Nunes
` (4 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
---
plugins/huaweicdma.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/plugins/huaweicdma.c b/plugins/huaweicdma.c
index 4c83114..9151ba8 100644
--- a/plugins/huaweicdma.c
+++ b/plugins/huaweicdma.c
@@ -211,7 +211,7 @@ static void huaweicdma_post_online(struct ofono_modem *modem)
DBG("%p", modem);
- ofono_cdma_netreg_create(modem, 0, "huaweicdmamodem", data->modem);
+ ofono_cdma_netreg_create(modem, 0, "huaweicdmamodem", data->pcui);
ofono_cdma_connman_create(modem, 0, "cdmamodem", data->modem);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 08/12] huaweicdma: Open qcdm port to be used for signal quality or network status
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (6 preceding siblings ...)
2011-12-08 14:49 ` [PATCH v2 07/12] huaweicdma: Use pcui port for cdma_netreg Philippe Nunes
@ 2011-12-08 14:49 ` Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 09/12] huaweicdmamodem: Probe the QCDM port with the version info request Philippe Nunes
` (3 subsequent siblings)
11 siblings, 0 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2464 bytes --]
---
plugins/huaweicdma.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/plugins/huaweicdma.c b/plugins/huaweicdma.c
index 9151ba8..0036b20 100644
--- a/plugins/huaweicdma.c
+++ b/plugins/huaweicdma.c
@@ -41,6 +41,7 @@
struct huaweicdma_data {
GAtChat *modem;
GAtChat *pcui;
+ GAtHDLC *hdlc;
};
static void huaweicdma_debug(const char *str, void *data)
@@ -75,6 +76,7 @@ static void huaweicdma_remove(struct ofono_modem *modem)
/* Cleanup after hot-unplug */
g_at_chat_unref(data->pcui);
+ g_at_hdlc_unref(data->hdlc);
g_free(data);
}
@@ -92,6 +94,9 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_unref(data->pcui);
data->pcui = NULL;
+
+ g_at_hdlc_unref(data->hdlc);
+ data->hdlc = NULL;
}
ofono_modem_set_powered(modem, ok);
@@ -130,6 +135,38 @@ static GAtChat *open_device(struct ofono_modem *modem,
return chat;
}
+static GAtHDLC *open_qcdm(struct ofono_modem *modem)
+{
+ const char *device;
+ GIOChannel *channel;
+ GAtHDLC *hdlc;
+
+ device = ofono_modem_get_string(modem, "Diag");
+ if (device == NULL)
+ return NULL;
+
+ DBG("Diagnostic Monitor %s", device);
+
+ channel = g_at_tty_open_qcdm(device);
+ if (channel == NULL)
+ return NULL;
+
+ hdlc = g_at_hdlc_new(channel);
+
+ g_io_channel_unref(channel);
+
+ if (hdlc == NULL)
+ return NULL;
+
+ if (getenv("OFONO_AT_DEBUG"))
+ g_at_hdlc_set_debug(hdlc, huaweicdma_debug, "HDLC: ");
+
+ g_at_hdlc_set_xmit_accm(hdlc, 0);
+ g_at_hdlc_set_recv_accm(hdlc, 0);
+
+ return hdlc;
+}
+
static int huaweicdma_enable(struct ofono_modem *modem)
{
struct huaweicdma_data *data = ofono_modem_get_data(modem);
@@ -147,6 +184,10 @@ static int huaweicdma_enable(struct ofono_modem *modem)
return -EIO;
}
+ data->hdlc = open_qcdm(modem);
+ if (data->hdlc != NULL)
+ g_at_chat_associate_diag_monitor(data->pcui, data->hdlc);
+
g_at_chat_send(data->modem, "ATE0 &C0 +CMEE=1", NULL, NULL, NULL, NULL);
g_at_chat_send(data->pcui, "ATE0 &C0 +CMEE=1", NULL, NULL, NULL, NULL);
@@ -182,6 +223,9 @@ static int huaweicdma_disable(struct ofono_modem *modem)
g_at_chat_unref(data->modem);
data->modem = NULL;
+ g_at_hdlc_unref(data->hdlc);
+ data->hdlc = NULL;
+
g_at_chat_cancel_all(data->pcui);
g_at_chat_unregister_all(data->pcui);
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 09/12] huaweicdmamodem: Probe the QCDM port with the version info request
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (7 preceding siblings ...)
2011-12-08 14:49 ` [PATCH v2 08/12] huaweicdma: Open qcdm port to be used for signal quality or network status Philippe Nunes
@ 2011-12-08 14:50 ` Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 10/12] huaweicdmamodem: Add 'serving_system' entry point to get SID Philippe Nunes
` (2 subsequent siblings)
11 siblings, 0 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:50 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4951 bytes --]
---
drivers/huaweicdmamodem/network-registration.c | 104 +++++++++++++++++++++---
1 files changed, 94 insertions(+), 10 deletions(-)
diff --git a/drivers/huaweicdmamodem/network-registration.c b/drivers/huaweicdmamodem/network-registration.c
index fc054d5..2432bf1 100644
--- a/drivers/huaweicdmamodem/network-registration.c
+++ b/drivers/huaweicdmamodem/network-registration.c
@@ -24,6 +24,8 @@
#endif
#define _GNU_SOURCE
+#include <string.h>
+#include <stdio.h>
#include <glib.h>
#include <errno.h>
@@ -35,8 +37,32 @@
#include "huaweicdmamodem.h"
+#define DIAG_CMD_VERSION_INFO 0 /* Version info */
+
static const char *sysinfo_prefix[] = { "^SYSINFO:", NULL };
+struct netreg_data {
+ GAtChat *chat;
+ GAtHDLC *diag;
+ guint8 cmd;
+};
+
+struct version_info {
+ guint8 code;
+ char comp_date[11];
+ char comp_time[8];
+ char rel_date[11];
+ char rel_time[8];
+ char model[8];
+ guint8 scm;
+ guint8 mob_cai_rev;
+ guint8 mob_model;
+ guint16 mob_firmware_rev;
+ guint8 slot_cycle_index;
+ guint8 msm_ver;
+ guint8 unknown;
+} __attribute__ ((packed));
+
static gboolean parse_sysinfo(GAtResult *result, gint *status)
{
GAtResultIter iter;
@@ -107,12 +133,56 @@ static void sysinfo_cb(gboolean ok, GAtResult *result, gpointer user_data)
ofono_cdma_netreg_status_notify(netreg, status);
}
+static void send_command(GAtHDLC *hdlc, guint8 cmd)
+{
+ unsigned char cmdbuf[1];
+
+ cmdbuf[0] = cmd;
+
+ g_at_hdlc_send(hdlc, cmdbuf, sizeof(cmdbuf));
+}
+
+static void hdlc_receive(const unsigned char *buf, gsize len, void *user_data)
+{
+ struct ofono_cdma_netreg *netreg = user_data;
+ struct netreg_data *nd = ofono_cdma_netreg_get_data(netreg);
+
+ if (nd->cmd == DIAG_CMD_VERSION_INFO) {
+ struct version_info *verinfo;
+ char str[12];
+
+ if (len < 1 || len > sizeof(struct version_info) ||
+ nd->cmd != buf[0]) {
+ /* This is probably not a QCDM port */
+ g_at_hdlc_unref(nd->diag);
+ nd->diag = NULL;
+ return;
+ }
+
+ DBG("Version information\n");
+ verinfo = (struct version_info *)buf;
+ snprintf(str, 12, "%s", verinfo->comp_date);
+ DBG("Compiled Date: %s\n", str);
+ snprintf(str, 9, "%s", verinfo->comp_time);
+ DBG("Compiled Time: %s\n", str);
+ snprintf(str, 12, "%s", verinfo->rel_date);
+ DBG("Release Date: %s\n", str);
+ snprintf(str, 9, "%s", verinfo->rel_time);
+ DBG("Release Time: %s\n", str);
+ snprintf(str, 9, "%s", verinfo->model);
+ DBG("Model: %s\n", str);
+ DBG("MSM version: %d\n", verinfo->msm_ver);
+ }
+
+ return;
+}
+
static void mode_notify(GAtResult *result, gpointer user_data)
{
struct ofono_cdma_netreg *netreg = user_data;
- GAtChat *chat = ofono_cdma_netreg_get_data(netreg);
+ struct netreg_data *nd = ofono_cdma_netreg_get_data(netreg);
- g_at_chat_send(chat, "AT^SYSINFO", sysinfo_prefix,
+ g_at_chat_send(nd->chat, "AT^SYSINFO", sysinfo_prefix,
sysinfo_cb, netreg, NULL);
}
@@ -169,17 +239,17 @@ error:
static void probe_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_cdma_netreg *netreg = user_data;
- GAtChat *chat = ofono_cdma_netreg_get_data(netreg);
+ struct netreg_data *nd = ofono_cdma_netreg_get_data(netreg);
if (!ok) {
ofono_cdma_netreg_remove(netreg);
return;
}
- g_at_chat_register(chat, "^MODE:",
+ g_at_chat_register(nd->chat, "^MODE:",
mode_notify, FALSE, netreg, NULL);
- g_at_chat_register(chat, "^RSSILVL:",
+ g_at_chat_register(nd->chat, "^RSSILVL:",
rssilvl_notify, FALSE, netreg, NULL);
g_at_chat_register(chat, "^HRSSILVL:",
@@ -191,23 +261,37 @@ static void probe_cb(gboolean ok, GAtResult *result, gpointer user_data)
static int huaweicdma_netreg_probe(struct ofono_cdma_netreg *netreg,
unsigned int vendor, void *data)
{
- GAtChat *chat = g_at_chat_clone(data);
+ struct netreg_data *nd;
+
+ nd = g_new0(struct netreg_data, 1);
+
+ nd->chat = g_at_chat_clone(data);
+ nd->diag = g_at_chat_get_diag_monitor(data);
- ofono_cdma_netreg_set_data(netreg, chat);
+ ofono_cdma_netreg_set_data(netreg, nd);
- g_at_chat_send(chat, "AT^SYSINFO", sysinfo_prefix,
+ g_at_chat_send(nd->chat, "AT^SYSINFO", sysinfo_prefix,
probe_cb, netreg, NULL);
+ if (nd->diag) {
+ g_at_hdlc_set_receive(nd->diag, hdlc_receive, netreg);
+ /* Request version info to probe the QCDM port */
+ nd->cmd = DIAG_CMD_VERSION_INFO;
+ send_command(nd->diag, nd->cmd);
+ }
+
return 0;
}
static void huaweicdma_netreg_remove(struct ofono_cdma_netreg *netreg)
{
- GAtChat *chat = ofono_cdma_netreg_get_data(netreg);
+ struct netreg_data *nd = ofono_cdma_netreg_get_data(netreg);
ofono_cdma_netreg_set_data(netreg, NULL);
- g_at_chat_unref(chat);
+ g_at_chat_unref(nd->chat);
+ g_at_hdlc_unref(nd->diag);
+ g_free(nd);
}
static struct ofono_cdma_netreg_driver driver = {
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 10/12] huaweicdmamodem: Add 'serving_system' entry point to get SID
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (8 preceding siblings ...)
2011-12-08 14:50 ` [PATCH v2 09/12] huaweicdmamodem: Probe the QCDM port with the version info request Philippe Nunes
@ 2011-12-08 14:50 ` Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 11/12] udevng: Add a default assignment for Huawei QCDM port Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 12/12] huaweicdmamodem: Fix sysinfo parsing Philippe Nunes
11 siblings, 0 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:50 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5609 bytes --]
---
drivers/huaweicdmamodem/network-registration.c | 141 ++++++++++++++++++++++++
1 files changed, 141 insertions(+), 0 deletions(-)
diff --git a/drivers/huaweicdmamodem/network-registration.c b/drivers/huaweicdmamodem/network-registration.c
index 2432bf1..8b6378c 100644
--- a/drivers/huaweicdmamodem/network-registration.c
+++ b/drivers/huaweicdmamodem/network-registration.c
@@ -36,8 +36,10 @@
#include "gatchat.h"
#include "huaweicdmamodem.h"
+#include <drivers/atmodem/atutil.h>
#define DIAG_CMD_VERSION_INFO 0 /* Version info */
+#define DIAG_CMD_STATUS 12 /* Station status */
static const char *sysinfo_prefix[] = { "^SYSINFO:", NULL };
@@ -45,6 +47,8 @@ struct netreg_data {
GAtChat *chat;
GAtHDLC *diag;
guint8 cmd;
+ void *cb;
+ void *cb_data;
};
struct version_info {
@@ -63,6 +67,32 @@ struct version_info {
guint8 unknown;
} __attribute__ ((packed));
+struct cdma_status {
+ guint8 code;
+ guint8 _unknown[3];
+ guint8 esn[4];
+ guint16 rf_mode;
+ guint8 min1_analog[4];
+ guint8 min1_cdma[4];
+ guint8 min2_analog[2];
+ guint8 min2_cdma[2];
+ guint8 _unknown1;
+ guint16 cdma_rx_state;
+ guint8 good_frames;
+ guint16 analog_corrected_frames;
+ guint16 analog_bad_frames;
+ guint16 analog_word_syncs;
+ guint16 entry_reason;
+ guint16 curr_chan;
+ guint8 cdma_code_chan;
+ guint16 pilot_base;
+ guint16 sid;
+ guint16 nid;
+ guint16 analog_locaid;
+ guint16 analog_rssi;
+ guint8 analog_power;
+} __attribute__ ((packed));
+
static gboolean parse_sysinfo(GAtResult *result, gint *status)
{
GAtResultIter iter;
@@ -133,6 +163,66 @@ static void sysinfo_cb(gboolean ok, GAtResult *result, gpointer user_data)
ofono_cdma_netreg_status_notify(netreg, status);
}
+static gboolean parse_css(GAtResult *result, const char **sid)
+{
+ GAtResultIter iter;
+ /*
+ * According TIA/EIA/IS-707, CSS query returns <AB>,<SID> but
+ * according TIA/EIA/IS-707-A , it returns <Band_Class>,<Band>,<SID>.
+ * PREV field which has been added afterward is ignored
+ */
+
+ g_at_result_iter_init(&iter, result);
+
+ g_at_result_iter_next(&iter, NULL);
+
+ /* Skip first field since we are not interested in this */
+ if (!g_at_result_iter_skip_next(&iter))
+ return FALSE;
+
+ if (!g_at_result_iter_next_unquoted_string(&iter, sid))
+ return FALSE;
+ /*
+ * As CSS answer may differ according which revision of TIA/EIA/IS-707
+ * the modem is compliant, we need to check if this field is Band or SID
+ */
+ if ((*sid[0] >= 'A' && *sid[0] <= 'F') || (*sid[0] == 'Z'))
+ /* This is the band field, the next field is the SID*/
+ if (!g_at_result_iter_next_unquoted_string(&iter, sid))
+ return FALSE;
+
+ if (!strcmp(*sid, "99999"))
+ /* The mobile station is not registered.*/
+ return FALSE;
+
+ return TRUE;
+}
+
+static void serving_system_cb(gboolean ok, GAtResult *result,
+ gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_cdma_netreg_serving_system_cb_t cb = cbd->cb;
+ struct ofono_error error;
+ const char *sid;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ cb(&error, NULL, cbd->data);
+ return;
+ }
+
+ if (parse_css(result, &sid) == FALSE) {
+ CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
+ return;
+ }
+
+ DBG("serving system: SID %s", sid);
+
+ cb(&error, sid, cbd->data);
+}
+
static void send_command(GAtHDLC *hdlc, guint8 cmd)
{
unsigned char cmdbuf[1];
@@ -172,6 +262,35 @@ static void hdlc_receive(const unsigned char *buf, gsize len, void *user_data)
snprintf(str, 9, "%s", verinfo->model);
DBG("Model: %s\n", str);
DBG("MSM version: %d\n", verinfo->msm_ver);
+ } else if (nd->cmd == DIAG_CMD_STATUS) {
+ ofono_cdma_netreg_serving_system_cb_t cb = nd->cb;
+ struct cdma_status *status;
+ char str[6];
+
+ if (len < 1 || len > sizeof(struct cdma_status) ||
+ nd->cmd != buf[0]) {
+ /* fall back to use +CSS */
+ if (g_at_chat_send(nd->chat, "AT+CSS=?", NULL,
+ serving_system_cb, netreg, NULL) > 0)
+ return;
+
+ CALLBACK_WITH_FAILURE(cb, NULL, nd->cb_data);
+ return;
+ }
+
+ DBG("Status command response\n");
+ status = (struct cdma_status *) (buf);
+ DBG("Serving Identification number: SID %d", status->sid);
+ DBG("Network Identification number NID: %d", status->nid);
+
+ /* check if network is registered */
+ if (status->cdma_rx_state == 0) {
+ CALLBACK_WITH_FAILURE(cb, NULL, nd->cb_data);
+ return;
+ }
+
+ snprintf(str, 6, "%d", status->sid);
+ CALLBACK_WITH_SUCCESS(cb, str, nd->cb_data);
}
return;
@@ -294,10 +413,32 @@ static void huaweicdma_netreg_remove(struct ofono_cdma_netreg *netreg)
g_free(nd);
}
+static void huaweicdma_netreg_serving_system(struct ofono_cdma_netreg *netreg,
+ ofono_cdma_netreg_serving_system_cb_t cb, void *data)
+{
+ struct netreg_data *nd = ofono_cdma_netreg_get_data(netreg);
+
+ nd->cb = cb;
+ nd->cb_data = data;
+
+ /* First use QCDM port if any */
+ if (nd->diag) {
+ /* Request Station status */
+ nd->cmd = 0x0c;
+ send_command(nd->diag, nd->cmd);
+ return;
+ } else if (g_at_chat_send(nd->chat, "AT+CSS=?", NULL,
+ serving_system_cb, netreg, NULL) > 0)
+ return;
+
+ CALLBACK_WITH_FAILURE(cb, NULL, data);
+}
+
static struct ofono_cdma_netreg_driver driver = {
.name = "huaweicdmamodem",
.probe = huaweicdma_netreg_probe,
.remove = huaweicdma_netreg_remove,
+ .serving_system = huaweicdma_netreg_serving_system,
};
void huaweicdma_netreg_init(void)
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 11/12] udevng: Add a default assignment for Huawei QCDM port
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (9 preceding siblings ...)
2011-12-08 14:50 ` [PATCH v2 10/12] huaweicdmamodem: Add 'serving_system' entry point to get SID Philippe Nunes
@ 2011-12-08 14:50 ` Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 12/12] huaweicdmamodem: Fix sysinfo parsing Philippe Nunes
11 siblings, 0 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:50 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]
---
plugins/udevng.c | 30 +++++++++++++++++++++---------
1 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/plugins/udevng.c b/plugins/udevng.c
index be87320..67660e3 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -235,6 +235,7 @@ static gboolean setup_sierra(struct modem_info *modem)
static gboolean setup_huawei(struct modem_info *modem)
{
const char *mdm = NULL, *pcui = NULL, *diag = NULL;
+ const char *default_pcui = NULL;
GSList *list;
DBG("%s", modem->syspath);
@@ -264,22 +265,33 @@ static gboolean setup_huawei(struct modem_info *modem)
if (mdm != NULL && pcui != NULL)
break;
} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
- if (g_strcmp0(info->number, "00") == 0)
+ if (mdm == NULL && g_strcmp0(info->number, "00") == 0)
mdm = info->devnode;
- else if (g_strcmp0(info->number, "01") == 0)
- pcui = info->devnode;
- else if (g_strcmp0(info->number, "02") == 0)
- pcui = info->devnode;
- else if (g_strcmp0(info->number, "03") == 0)
- pcui = info->devnode;
- else if (g_strcmp0(info->number, "04") == 0)
- pcui = info->devnode;
+ else if (diag == NULL) {
+ if (g_strcmp0(info->number, "01") == 0)
+ diag = info->devnode;
+ } else if (pcui == NULL) {
+ if (g_strcmp0(info->number, "01") == 0)
+ default_pcui = info->devnode;
+ else if (g_strcmp0(info->number, "02") == 0)
+ default_pcui = info->devnode;
+ else if (g_strcmp0(info->number, "03") == 0)
+ default_pcui = info->devnode;
+ else if (g_strcmp0(info->number, "04") == 0)
+ default_pcui = info->devnode;
+ }
}
}
+ if (pcui == NULL && default_pcui != NULL)
+ pcui = default_pcui;
+
if (mdm == NULL || pcui == NULL)
return FALSE;
+ if (diag != NULL && g_strcmp0(diag, pcui) == 0)
+ diag = NULL;
+
DBG("modem=%s pcui=%s diag=%s", mdm, pcui, diag);
ofono_modem_set_string(modem->modem, "Modem", mdm);
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 12/12] huaweicdmamodem: Fix sysinfo parsing
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
` (10 preceding siblings ...)
2011-12-08 14:50 ` [PATCH v2 11/12] udevng: Add a default assignment for Huawei QCDM port Philippe Nunes
@ 2011-12-08 14:50 ` Philippe Nunes
2011-12-09 12:14 ` Denis Kenzior
11 siblings, 1 reply; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 14:50 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 920 bytes --]
In practice, the service domain is set to 255 (cdma not supported)
with an EV-DO capable hardware.
---
drivers/huaweicdmamodem/network-registration.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/huaweicdmamodem/network-registration.c b/drivers/huaweicdmamodem/network-registration.c
index 8b6378c..ca746f8 100644
--- a/drivers/huaweicdmamodem/network-registration.c
+++ b/drivers/huaweicdmamodem/network-registration.c
@@ -134,13 +134,13 @@ static gboolean parse_sysinfo(GAtResult *result, gint *status)
switch (srv_domain) {
case 0: /* No service */
- case 255: /* CDMA not supported */
*status = CDMA_NETWORK_REGISTRATION_STATUS_NOT_REGISTERED;
break;
case 1: /* Only CS */
case 2: /* Only PS */
case 3: /* CS PS */
case 4: /* CS registered, PS in searching state */
+ case 255: /* CDMA not supported */
break;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port
2011-12-08 16:07 ` Philippe Nunes
@ 2011-12-08 15:17 ` Marcel Holtmann
2011-12-08 16:50 ` Philippe Nunes
0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2011-12-08 15:17 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]
Hi Philippe,
> >> gatchat/gatchat.c | 26 ++++++++++++++++++++++++++
> >> gatchat/gatchat.h | 4 ++++
> >> 2 files changed, 30 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
> >> index 7a0ef35..00e5fa8 100644
> >> --- a/gatchat/gatchat.c
> >> +++ b/gatchat/gatchat.c
> >> @@ -35,6 +35,7 @@
> >> #include "ringbuffer.h"
> >> #include "gatchat.h"
> >> #include "gatio.h"
> >> +#include "gathdlc.h"
> >>
> >> /* #define WRITE_SCHEDULER_DEBUG 1 */
> >>
> >> @@ -110,6 +111,7 @@ struct _GAtChat {
> >> struct at_chat *parent;
> >> guint group;
> >> GAtChat *slave;
> >> + GAtHDLC *diag_monitor;
> >> };
> >
> > what is this for? I don't see this needed at all. You are not crossing
> > atom driver implementations anyway.
>
> Here, the idea is to link one AT capable port to one Diagnostic port.
> Commonly, we are specifying only one AT capable channel (GAtChat) when
> creating an atom.
> For cdma_netreg, I need both (AT and QCDM). Indeed, with some EV-DO
> capable hardware, the result of some AT commands (like AT+CSS?) may be
> wrong. That's why, I introduced the QCDM support. To retrieve the
> GAtHDLC from the driver implementation, I chose to use a solution
> similar to 'g_at_chat_get_slave'.
why both? Isn't QCDM only enough?
Regards
Marcel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port
2011-12-08 14:13 ` Marcel Holtmann
@ 2011-12-08 16:07 ` Philippe Nunes
2011-12-08 15:17 ` Marcel Holtmann
0 siblings, 1 reply; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 16:07 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1336 bytes --]
Hi Marcel,
On 12/08/2011 03:13 PM, Marcel Holtmann wrote:
> Hi Philippe,
>
>> gatchat/gatchat.c | 26 ++++++++++++++++++++++++++
>> gatchat/gatchat.h | 4 ++++
>> 2 files changed, 30 insertions(+), 0 deletions(-)
>>
>> diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
>> index 7a0ef35..00e5fa8 100644
>> --- a/gatchat/gatchat.c
>> +++ b/gatchat/gatchat.c
>> @@ -35,6 +35,7 @@
>> #include "ringbuffer.h"
>> #include "gatchat.h"
>> #include "gatio.h"
>> +#include "gathdlc.h"
>>
>> /* #define WRITE_SCHEDULER_DEBUG 1 */
>>
>> @@ -110,6 +111,7 @@ struct _GAtChat {
>> struct at_chat *parent;
>> guint group;
>> GAtChat *slave;
>> + GAtHDLC *diag_monitor;
>> };
>
> what is this for? I don't see this needed at all. You are not crossing
> atom driver implementations anyway.
Here, the idea is to link one AT capable port to one Diagnostic port.
Commonly, we are specifying only one AT capable channel (GAtChat) when
creating an atom.
For cdma_netreg, I need both (AT and QCDM). Indeed, with some EV-DO
capable hardware, the result of some AT commands (like AT+CSS?) may be
wrong. That's why, I introduced the QCDM support. To retrieve the
GAtHDLC from the driver implementation, I chose to use a solution
similar to 'g_at_chat_get_slave'.
Regards,
Philippe.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port
2011-12-08 15:17 ` Marcel Holtmann
@ 2011-12-08 16:50 ` Philippe Nunes
0 siblings, 0 replies; 22+ messages in thread
From: Philippe Nunes @ 2011-12-08 16:50 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2006 bytes --]
Hi Marcel,
On 12/08/2011 04:17 PM, Marcel Holtmann wrote:
> Hi Philippe,
>
>>>> gatchat/gatchat.c | 26 ++++++++++++++++++++++++++
>>>> gatchat/gatchat.h | 4 ++++
>>>> 2 files changed, 30 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
>>>> index 7a0ef35..00e5fa8 100644
>>>> --- a/gatchat/gatchat.c
>>>> +++ b/gatchat/gatchat.c
>>>> @@ -35,6 +35,7 @@
>>>> #include "ringbuffer.h"
>>>> #include "gatchat.h"
>>>> #include "gatio.h"
>>>> +#include "gathdlc.h"
>>>>
>>>> /* #define WRITE_SCHEDULER_DEBUG 1 */
>>>>
>>>> @@ -110,6 +111,7 @@ struct _GAtChat {
>>>> struct at_chat *parent;
>>>> guint group;
>>>> GAtChat *slave;
>>>> + GAtHDLC *diag_monitor;
>>>> };
>>>
>>> what is this for? I don't see this needed at all. You are not crossing
>>> atom driver implementations anyway.
>>
>> Here, the idea is to link one AT capable port to one Diagnostic port.
>> Commonly, we are specifying only one AT capable channel (GAtChat) when
>> creating an atom.
>> For cdma_netreg, I need both (AT and QCDM). Indeed, with some EV-DO
>> capable hardware, the result of some AT commands (like AT+CSS?) may be
>> wrong. That's why, I introduced the QCDM support. To retrieve the
>> GAtHDLC from the driver implementation, I chose to use a solution
>> similar to 'g_at_chat_get_slave'.
>
> why both? Isn't QCDM only enough?
>
Yes, I presume we could manage by using only QCDM but according to me,
it would be more complex. Without unsolicited result codes, we are
obliged to perform a network status pooling and to cover all the
features (1x/HDR signal quality, dormancy state) we need to extend
greatly our QCDM handler.
Now, I feel too bad to not use an available AT capable port.
Regards,
Philippe.
> Regards
>
> Marcel
>
>
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> http://lists.ofono.org/listinfo/ofono
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 01/12] cdma-providers: add driver APIs header
2011-12-08 14:49 ` [PATCH v2 01/12] cdma-providers: add driver APIs header Philippe Nunes
@ 2011-12-09 11:50 ` Denis Kenzior
0 siblings, 0 replies; 22+ messages in thread
From: Denis Kenzior @ 2011-12-09 11:50 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]
Hi Philippe,
On 12/08/2011 08:49 AM, Philippe Nunes wrote:
> ---
> include/cdma-providers.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 44 insertions(+), 0 deletions(-)
> create mode 100644 include/cdma-providers.h
>
> diff --git a/include/cdma-providers.h b/include/cdma-providers.h
> new file mode 100644
> index 0000000..6878087
> --- /dev/null
> +++ b/include/cdma-providers.h
> @@ -0,0 +1,44 @@
> +/*
> + *
> + * oFono - Open Source Telephony
> + *
> + * Copyright (C) 2008-2011 Intel 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 __OFONO_CDMA_PROVIDERS_H
> +#define __OFONO_CDMA_PROVIDERS_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +struct ofono_cdma_providers_driver {
> + const char *name;
> + int priority;
> + int (*get_provider_name)(const char *sid, char **name);
> +};
Please rename this to ofono_cdma_provision_driver. We can later expand
this to provision username and password settings.
> +
> +int ofono_cdma_providers_driver_register(
> + const struct ofono_cdma_providers_driver *driver);
> +void ofono_cdma_providers_driver_unregister(
> + const struct ofono_cdma_providers_driver *driver);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* __OFONO_CDMA_PROVIDERS_H */
Regards
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 02/12] ofono.h: add cdma-providers
2011-12-08 14:49 ` [PATCH v2 02/12] ofono.h: add cdma-providers Philippe Nunes
@ 2011-12-09 11:52 ` Denis Kenzior
0 siblings, 0 replies; 22+ messages in thread
From: Denis Kenzior @ 2011-12-09 11:52 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
Hi Philippe,
On 12/08/2011 08:49 AM, Philippe Nunes wrote:
> ---
> src/ofono.h | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/src/ofono.h b/src/ofono.h
> index bfb534d..a26c06d 100644
> --- a/src/ofono.h
> +++ b/src/ofono.h
> @@ -487,6 +487,10 @@ void __ofono_gprs_provision_free_settings(
> #include <ofono/gnss.h>
> #include <ofono/cdma-sms.h>
> #include <ofono/cdma-netreg.h>
> +
> +#include <ofono/cdma-providers.h>
> +ofono_bool_t __ofono_cdma_providers_get_name(const char *sid, char **name);
> +
Similarly, please name this cdma_provision_get_name..
> #include <ofono/private-network.h>
>
> void __ofono_private_network_release(int id);
Regards,
-Denis
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port
2011-12-08 14:49 ` [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port Philippe Nunes
2011-12-08 14:13 ` Marcel Holtmann
@ 2011-12-09 12:09 ` Denis Kenzior
1 sibling, 0 replies; 22+ messages in thread
From: Denis Kenzior @ 2011-12-09 12:09 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2384 bytes --]
Hi Philippe,
On 12/08/2011 08:49 AM, Philippe Nunes wrote:
> ---
> gatchat/gatchat.c | 26 ++++++++++++++++++++++++++
> gatchat/gatchat.h | 4 ++++
> 2 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
> index 7a0ef35..00e5fa8 100644
> --- a/gatchat/gatchat.c
> +++ b/gatchat/gatchat.c
> @@ -35,6 +35,7 @@
> #include "ringbuffer.h"
> #include "gatchat.h"
> #include "gatio.h"
> +#include "gathdlc.h"
>
> /* #define WRITE_SCHEDULER_DEBUG 1 */
>
> @@ -110,6 +111,7 @@ struct _GAtChat {
> struct at_chat *parent;
> guint group;
> GAtChat *slave;
> + GAtHDLC *diag_monitor;
> };
>
> struct terminator_info {
> @@ -1354,6 +1356,30 @@ GAtChat *g_at_chat_get_slave(GAtChat *chat)
> return chat->slave;
> }
>
> +GAtHDLC *g_at_chat_associate_diag_monitor(GAtChat *chat, GAtHDLC *diag)
> +{
> + if (chat == NULL)
> + return NULL;
> +
> + if (chat->diag_monitor != NULL)
> + g_at_hdlc_unref(chat->diag_monitor);
> +
> + if (diag != NULL)
> + chat->diag_monitor = g_at_hdlc_ref(diag);
> + else
> + chat->diag_monitor = NULL;
> +
> + return chat->diag_monitor;
> +}
> +
> +GAtHDLC *g_at_chat_get_diag_monitor(GAtChat *chat)
> +{
> + if (chat == NULL)
> + return NULL;
> +
> + return chat->diag_monitor;
> +}
> +
> GIOChannel *g_at_chat_get_channel(GAtChat *chat)
> {
> if (chat == NULL || chat->parent->io == NULL)
> diff --git a/gatchat/gatchat.h b/gatchat/gatchat.h
> index 367581e..d8863b8 100644
> --- a/gatchat/gatchat.h
> +++ b/gatchat/gatchat.h
> @@ -30,6 +30,7 @@ extern "C" {
> #include "gatsyntax.h"
> #include "gatutil.h"
> #include "gatio.h"
> +#include "gathdlc.h"
>
> struct _GAtChat;
>
> @@ -68,6 +69,9 @@ GAtChat *g_at_chat_clone(GAtChat *chat);
> GAtChat *g_at_chat_set_slave(GAtChat *chat, GAtChat *slave);
> GAtChat *g_at_chat_get_slave(GAtChat *chat);
>
> +GAtHDLC *g_at_chat_associate_diag_monitor(GAtChat *chat, GAtHDLC *diag);
> +GAtHDLC *g_at_chat_get_diag_monitor(GAtChat *chat);
I'm not happy with the naming, can we use something like
g_at_chat_set_slave_qcdm. GAtChat is not the best example of naming
consistency, but lets try to be consistent whenever we can ;)
> +
> void g_at_chat_suspend(GAtChat *chat);
> void g_at_chat_resume(GAtChat *chat);
>
Regards,
-Denis
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 07/12] huaweicdma: Use pcui port for cdma_netreg
2011-12-08 14:49 ` [PATCH v2 07/12] huaweicdma: Use pcui port for cdma_netreg Philippe Nunes
@ 2011-12-09 12:11 ` Denis Kenzior
0 siblings, 0 replies; 22+ messages in thread
From: Denis Kenzior @ 2011-12-09 12:11 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 217 bytes --]
Hi Philippe,
On 12/08/2011 08:49 AM, Philippe Nunes wrote:
> ---
> plugins/huaweicdma.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
Patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 12/12] huaweicdmamodem: Fix sysinfo parsing
2011-12-08 14:50 ` [PATCH v2 12/12] huaweicdmamodem: Fix sysinfo parsing Philippe Nunes
@ 2011-12-09 12:14 ` Denis Kenzior
0 siblings, 0 replies; 22+ messages in thread
From: Denis Kenzior @ 2011-12-09 12:14 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 348 bytes --]
Hi Philippe,
On 12/08/2011 08:50 AM, Philippe Nunes wrote:
> In practice, the service domain is set to 255 (cdma not supported)
> with an EV-DO capable hardware.
> ---
> drivers/huaweicdmamodem/network-registration.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
Patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2011-12-09 12:14 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-08 14:49 [PATCH v2 00/12] Provider name and SID Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 01/12] cdma-providers: add driver APIs header Philippe Nunes
2011-12-09 11:50 ` Denis Kenzior
2011-12-08 14:49 ` [PATCH v2 02/12] ofono.h: add cdma-providers Philippe Nunes
2011-12-09 11:52 ` Denis Kenzior
2011-12-08 14:49 ` [PATCH v2 03/12] cdma-providers: add driver APIs implementation Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 04/12] providers: Add cdma provider name plugin Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 05/12] cdma-netreg: Add provider name and SID support Philippe Nunes
2011-12-08 14:49 ` [PATCH v2 06/12] gatchat: Add possibility to associate a diagnostic monitor to the AT-capable port Philippe Nunes
2011-12-08 14:13 ` Marcel Holtmann
2011-12-08 16:07 ` Philippe Nunes
2011-12-08 15:17 ` Marcel Holtmann
2011-12-08 16:50 ` Philippe Nunes
2011-12-09 12:09 ` Denis Kenzior
2011-12-08 14:49 ` [PATCH v2 07/12] huaweicdma: Use pcui port for cdma_netreg Philippe Nunes
2011-12-09 12:11 ` Denis Kenzior
2011-12-08 14:49 ` [PATCH v2 08/12] huaweicdma: Open qcdm port to be used for signal quality or network status Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 09/12] huaweicdmamodem: Probe the QCDM port with the version info request Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 10/12] huaweicdmamodem: Add 'serving_system' entry point to get SID Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 11/12] udevng: Add a default assignment for Huawei QCDM port Philippe Nunes
2011-12-08 14:50 ` [PATCH v2 12/12] huaweicdmamodem: Fix sysinfo parsing Philippe Nunes
2011-12-09 12:14 ` Denis Kenzior
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.