Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems
@ 2011-12-08 11:00 Guillaume Zajac
  2011-12-08 11:00 ` [PATCH_v1 1/4] cdma-connman: Add dormant state notification API Guillaume Zajac
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Guillaume Zajac @ 2011-12-08 11:00 UTC (permalink / raw)
  To: ofono

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

Hi,

Change log from v0:
	- Only notify the dormant state to the cdma-connman atom
	- A new set of patches will be sent to control dormancy
	  mode.

Kind regards,
Guillaume

Guillaume Zajac (4):
  cdma-connman: Add dormant state notification API
  cdma-connman: Add dormant state notification API definition
  huaweicdma: Tweak plugin to notify dormant state
  cdmamodem: Register dormant state callback for huawei modems

 drivers/cdmamodem/connman.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 include/cdma-connman.h      |    3 +++
 plugins/huaweicdma.c        |    7 ++++++-
 src/cdma-connman.c          |   17 +++++++++++++++++
 4 files changed, 68 insertions(+), 1 deletions(-)


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

* [PATCH_v1 1/4] cdma-connman: Add dormant state notification API
  2011-12-08 11:00 [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Guillaume Zajac
@ 2011-12-08 11:00 ` Guillaume Zajac
  2011-12-08 11:00 ` [PATCH_v1 2/4] cdma-connman: Add dormant state notification API definition Guillaume Zajac
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Guillaume Zajac @ 2011-12-08 11:00 UTC (permalink / raw)
  To: ofono

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

---
 include/cdma-connman.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/cdma-connman.h b/include/cdma-connman.h
index 7a115bf..d2ffa0f 100644
--- a/include/cdma-connman.h
+++ b/include/cdma-connman.h
@@ -66,6 +66,9 @@ void ofono_cdma_connman_driver_unregister(
 
 void ofono_cdma_connman_deactivated(struct ofono_cdma_connman *cm);
 
+void ofono_cdma_connman_dormant_state_notify(struct ofono_cdma_connman *cm,
+						ofono_bool_t dormant);
+
 struct ofono_cdma_connman *ofono_cdma_connman_create(
 						struct ofono_modem *modem,
 						unsigned int vendor,
-- 
1.7.1


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

* [PATCH_v1 2/4] cdma-connman: Add dormant state notification API definition
  2011-12-08 11:00 [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Guillaume Zajac
  2011-12-08 11:00 ` [PATCH_v1 1/4] cdma-connman: Add dormant state notification API Guillaume Zajac
@ 2011-12-08 11:00 ` Guillaume Zajac
  2011-12-08 11:00 ` [PATCH_v1 3/4] huaweicdma: Tweak plugin to notify dormant state Guillaume Zajac
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Guillaume Zajac @ 2011-12-08 11:00 UTC (permalink / raw)
  To: ofono

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

---
 src/cdma-connman.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/cdma-connman.c b/src/cdma-connman.c
index 87cefd6..d796d9e 100644
--- a/src/cdma-connman.c
+++ b/src/cdma-connman.c
@@ -572,6 +572,23 @@ void ofono_cdma_connman_deactivated(struct ofono_cdma_connman *cm)
 				"Powered", DBUS_TYPE_BOOLEAN, &value);
 }
 
+void ofono_cdma_connman_dormant_state_notify(struct ofono_cdma_connman *cm,
+						ofono_bool_t dormant)
+{
+	DBusConnection *conn = ofono_dbus_get_connection();
+	const char *path;
+
+	if (cm == NULL)
+		return;
+
+	cm->dormant = dormant;
+	path = __ofono_atom_get_path(cm->atom);
+
+	ofono_dbus_signal_property_changed(conn, path,
+				OFONO_CDMA_CONNECTION_MANAGER_INTERFACE,
+				"Dormant", DBUS_TYPE_BOOLEAN, &dormant);
+}
+
 static void cdma_connman_unregister(struct ofono_atom *atom)
 {
 	DBusConnection *conn = ofono_dbus_get_connection();
-- 
1.7.1


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

* [PATCH_v1 3/4] huaweicdma: Tweak plugin to notify dormant state
  2011-12-08 11:00 [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Guillaume Zajac
  2011-12-08 11:00 ` [PATCH_v1 1/4] cdma-connman: Add dormant state notification API Guillaume Zajac
  2011-12-08 11:00 ` [PATCH_v1 2/4] cdma-connman: Add dormant state notification API definition Guillaume Zajac
@ 2011-12-08 11:00 ` Guillaume Zajac
  2011-12-08 11:00 ` [PATCH_v1 4/4] cdmamodem: Register dormant state callback for huawei modems Guillaume Zajac
  2011-12-08 12:24 ` [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Denis Kenzior
  4 siblings, 0 replies; 6+ messages in thread
From: Guillaume Zajac @ 2011-12-08 11:00 UTC (permalink / raw)
  To: ofono

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

Specify vendor in creating cdma-connman atom.
Set PCUI interface as slave of MODEM interface to receive dormant
state notification during data call.
---
 plugins/huaweicdma.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/plugins/huaweicdma.c b/plugins/huaweicdma.c
index 4c83114..50b4761 100644
--- a/plugins/huaweicdma.c
+++ b/plugins/huaweicdma.c
@@ -38,6 +38,8 @@
 #include <ofono/cdma-connman.h>
 #include <ofono/log.h>
 
+#include "drivers/atmodem/vendor.h"
+
 struct huaweicdma_data {
 	GAtChat *modem;
 	GAtChat *pcui;
@@ -147,6 +149,8 @@ static int huaweicdma_enable(struct ofono_modem *modem)
 		return -EIO;
 	}
 
+	g_at_chat_set_slave(data->modem, data->pcui);
+
 	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);
 
@@ -213,7 +217,8 @@ static void huaweicdma_post_online(struct ofono_modem *modem)
 
 	ofono_cdma_netreg_create(modem, 0, "huaweicdmamodem", data->modem);
 
-	ofono_cdma_connman_create(modem, 0, "cdmamodem", data->modem);
+	ofono_cdma_connman_create(modem, OFONO_VENDOR_HUAWEI, "cdmamodem",
+					data->modem);
 }
 
 static struct ofono_modem_driver huaweicdma_driver = {
-- 
1.7.1


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

* [PATCH_v1 4/4] cdmamodem: Register dormant state callback for huawei modems
  2011-12-08 11:00 [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Guillaume Zajac
                   ` (2 preceding siblings ...)
  2011-12-08 11:00 ` [PATCH_v1 3/4] huaweicdma: Tweak plugin to notify dormant state Guillaume Zajac
@ 2011-12-08 11:00 ` Guillaume Zajac
  2011-12-08 12:24 ` [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Denis Kenzior
  4 siblings, 0 replies; 6+ messages in thread
From: Guillaume Zajac @ 2011-12-08 11:00 UTC (permalink / raw)
  To: ofono

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

---
 drivers/cdmamodem/connman.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/cdmamodem/connman.c b/drivers/cdmamodem/connman.c
index ec17e96..f27161b 100644
--- a/drivers/cdmamodem/connman.c
+++ b/drivers/cdmamodem/connman.c
@@ -41,6 +41,7 @@
 #include "gatppp.h"
 
 #include "cdmamodem.h"
+#include "drivers/atmodem/vendor.h"
 
 #define TUN_SYSFS_DIR "/sys/devices/virtual/misc/tun"
 
@@ -58,6 +59,7 @@ enum state {
 struct connman_data {
 	GAtChat *chat;
 	GAtPPP *ppp;
+	unsigned int vendor;
 	enum state state;
 	char username[OFONO_CDMA_CONNMAN_MAX_USERNAME_LENGTH + 1];
 	char password[OFONO_CDMA_CONNMAN_MAX_PASSWORD_LENGTH + 1];
@@ -220,9 +222,38 @@ static void cdma_connman_deactivate(struct ofono_cdma_connman *cm,
 	g_at_ppp_shutdown(cd->ppp);
 }
 
+static void huawei_dsdormant_notify(GAtResult *result, gpointer user_data)
+{
+	struct ofono_cdma_connman *cm = user_data;
+	int dormant_state;
+	GAtResultIter iter;
+
+	g_at_result_iter_init(&iter, result);
+
+	if (!g_at_result_iter_next(&iter, "^DSDORMANT:"))
+		goto error;
+
+	if (!g_at_result_iter_next_number(&iter, &dormant_state))
+		goto error;
+
+	if (dormant_state == 1)
+		ofono_cdma_connman_dormant_state_notify(cm, TRUE);
+	else if (dormant_state == 0)
+		ofono_cdma_connman_dormant_state_notify(cm, FALSE);
+	else
+		goto error;
+
+	return;
+
+error:
+	ofono_error("Invalid DSDORMANT value");
+}
+
 static void at_c0_cb(gboolean ok, GAtResult *result, gpointer user_data)
 {
 	struct ofono_cdma_connman *cm = user_data;
+	struct connman_data *cd = ofono_cdma_connman_get_data(cm);
+	GAtChat *chat;
 
 	DBG("ok %d", ok);
 
@@ -232,6 +263,16 @@ static void at_c0_cb(gboolean ok, GAtResult *result, gpointer user_data)
 		return;
 	}
 
+	switch (cd->vendor) {
+	case OFONO_VENDOR_HUAWEI:
+		chat = g_at_chat_get_slave(cd->chat);
+		g_at_chat_register(chat, "^DSDORMANT", huawei_dsdormant_notify,
+					FALSE, cm, NULL);
+		break;
+	default:
+		break;
+	}
+
 	ofono_cdma_connman_register(cm);
 }
 
@@ -254,6 +295,7 @@ static int cdma_connman_probe(struct ofono_cdma_connman *cm,
 		return -ENOMEM;
 
 	cd->chat = g_at_chat_clone(chat);
+	cd->vendor = vendor;
 
 	ofono_cdma_connman_set_data(cm, cd);
 
-- 
1.7.1


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

* Re: [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems
  2011-12-08 11:00 [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Guillaume Zajac
                   ` (3 preceding siblings ...)
  2011-12-08 11:00 ` [PATCH_v1 4/4] cdmamodem: Register dormant state callback for huawei modems Guillaume Zajac
@ 2011-12-08 12:24 ` Denis Kenzior
  4 siblings, 0 replies; 6+ messages in thread
From: Denis Kenzior @ 2011-12-08 12:24 UTC (permalink / raw)
  To: ofono

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

Hi Guillaume,

On 12/08/2011 05:00 AM, Guillaume Zajac wrote:
> Hi,
> 
> Change log from v0:
> 	- Only notify the dormant state to the cdma-connman atom
> 	- A new set of patches will be sent to control dormancy
> 	  mode.
> 
> Kind regards,
> Guillaume
> 
> Guillaume Zajac (4):
>   cdma-connman: Add dormant state notification API
>   cdma-connman: Add dormant state notification API definition
>   huaweicdma: Tweak plugin to notify dormant state
>   cdmamodem: Register dormant state callback for huawei modems
> 
>  drivers/cdmamodem/connman.c |   42 ++++++++++++++++++++++++++++++++++++++++++
>  include/cdma-connman.h      |    3 +++
>  plugins/huaweicdma.c        |    7 ++++++-
>  src/cdma-connman.c          |   17 +++++++++++++++++
>  4 files changed, 68 insertions(+), 1 deletions(-)
> 

I applied all four patches with minor amendments.  In the future please
pay attention to keeping your commit headers under 50 characters per
doc/coding-style.txt item M5.

Regards,
-Denis

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

end of thread, other threads:[~2011-12-08 12:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-08 11:00 [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Guillaume Zajac
2011-12-08 11:00 ` [PATCH_v1 1/4] cdma-connman: Add dormant state notification API Guillaume Zajac
2011-12-08 11:00 ` [PATCH_v1 2/4] cdma-connman: Add dormant state notification API definition Guillaume Zajac
2011-12-08 11:00 ` [PATCH_v1 3/4] huaweicdma: Tweak plugin to notify dormant state Guillaume Zajac
2011-12-08 11:00 ` [PATCH_v1 4/4] cdmamodem: Register dormant state callback for huawei modems Guillaume Zajac
2011-12-08 12:24 ` [PATCH_v1 0/4] Manage Dormant property notification for CDMA modems Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox