All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH 3/5] ss: Use function to judge if it's busy
Date: Tue, 21 Sep 2010 18:21:17 +0800	[thread overview]
Message-ID: <1285064479-12907-4-git-send-email-yang.gu@intel.com> (raw)
In-Reply-To: <1285064479-12907-1-git-send-email-yang.gu@intel.com>

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

---
 src/call-barring.c    |   12 ++++++------
 src/call-forwarding.c |   11 +++++++----
 src/call-settings.c   |   12 ++++++------
 3 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/src/call-barring.c b/src/call-barring.c
index d235211..d1a44cc 100644
--- a/src/call-barring.c
+++ b/src/call-barring.c
@@ -372,7 +372,7 @@ static gboolean cb_ss_control(int type, const char *sc,
 	void *operation = NULL;
 	int i;
 
-	if (cb->pending) {
+	if (__ofono_call_barring_is_busy(cb)) {
 		reply = __ofono_error_busy(msg);
 		g_dbus_send_message(conn, reply);
 
@@ -504,7 +504,7 @@ static gboolean cb_ss_passwd(const char *sc,
 	DBusMessage *reply;
 	const char *fac;
 
-	if (cb->pending) {
+	if (__ofono_call_barring_is_busy(cb)) {
 		reply = __ofono_error_busy(msg);
 		g_dbus_send_message(conn, reply);
 
@@ -674,7 +674,7 @@ static DBusMessage *cb_get_properties(DBusConnection *conn, DBusMessage *msg,
 {
 	struct ofono_call_barring *cb = data;
 
-	if (cb->pending || __ofono_ussd_is_busy(cb->ussd))
+	if (__ofono_call_barring_is_busy(cb) || __ofono_ussd_is_busy(cb->ussd))
 		return __ofono_error_busy(msg);
 
 	if (!cb->driver->query)
@@ -827,7 +827,7 @@ static DBusMessage *cb_set_property(DBusConnection *conn, DBusMessage *msg,
 	int cls;
 	int mode;
 
-	if (cb->pending || __ofono_ussd_is_busy(cb->ussd))
+	if (__ofono_call_barring_is_busy(cb) || __ofono_ussd_is_busy(cb->ussd))
 		return __ofono_error_busy(msg);
 
 	if (!dbus_message_iter_init(msg, &iter))
@@ -899,7 +899,7 @@ static DBusMessage *cb_disable_all(DBusConnection *conn, DBusMessage *msg,
 	if (!cb->driver->set)
 		return __ofono_error_not_implemented(msg);
 
-	if (cb->pending || __ofono_ussd_is_busy(cb->ussd))
+	if (__ofono_call_barring_is_busy(cb) || __ofono_ussd_is_busy(cb->ussd))
 		return __ofono_error_busy(msg);
 
 	if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &passwd,
@@ -946,7 +946,7 @@ static DBusMessage *cb_set_passwd(DBusConnection *conn, DBusMessage *msg,
 	if (!cb->driver->set_passwd)
 		return __ofono_error_not_implemented(msg);
 
-	if (cb->pending || __ofono_ussd_is_busy(cb->ussd))
+	if (__ofono_call_barring_is_busy(cb) || __ofono_ussd_is_busy(cb->ussd))
 		return __ofono_error_busy(msg);
 
 	if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &old_passwd,
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 5eae6cf..ea72913 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -430,7 +430,8 @@ static DBusMessage *cf_get_properties(DBusConnection *conn, DBusMessage *msg,
 	if (!cf->driver->query)
 		return __ofono_error_not_implemented(msg);
 
-	if (cf->pending || __ofono_ussd_is_busy(cf->ussd))
+	if (__ofono_call_forwarding_is_busy(cf) ||
+			__ofono_ussd_is_busy(cf->ussd))
 		return __ofono_error_busy(msg);
 
 	cf->pending = dbus_message_ref(msg);
@@ -586,7 +587,8 @@ static DBusMessage *cf_set_property(DBusConnection *conn, DBusMessage *msg,
 	int cls;
 	int type;
 
-	if (cf->pending || __ofono_ussd_is_busy(cf->ussd))
+	if (__ofono_call_forwarding_is_busy(cf) ||
+			__ofono_ussd_is_busy(cf->ussd))
 		return __ofono_error_busy(msg);
 
 	if (!dbus_message_iter_init(msg, &iter))
@@ -704,7 +706,8 @@ static DBusMessage *cf_disable_all(DBusConnection *conn, DBusMessage *msg,
 	if (!cf->driver->erasure)
 		return __ofono_error_not_implemented(msg);
 
-	if (cf->pending || __ofono_ussd_is_busy(cf->ussd))
+	if (__ofono_call_forwarding_is_busy(cf) ||
+			__ofono_ussd_is_busy(cf->ussd))
 		return __ofono_error_busy(msg);
 
 	if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &strtype,
@@ -895,7 +898,7 @@ static gboolean cf_ss_control(int type, const char *sc,
 	if (!cf)
 		return FALSE;
 
-	if (cf->pending) {
+	if (__ofono_call_forwarding_is_busy(cf)) {
 		reply = __ofono_error_busy(msg);
 		g_dbus_send_message(conn, reply);
 
diff --git a/src/call-settings.c b/src/call-settings.c
index 0c46a2a..16abc5e 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -418,7 +418,7 @@ static gboolean cw_ss_control(int type,
 	if (strcmp(sc, "43"))
 		return FALSE;
 
-	if (cs->pending) {
+	if (__ofono_call_settings_is_busy(cs)) {
 		reply = __ofono_error_busy(msg);
 		goto error;
 	}
@@ -576,7 +576,7 @@ static gboolean clip_colp_colr_ss(int type,
 	if (!cs)
 		return FALSE;
 
-	if (cs->pending) {
+	if (__ofono_call_settings_is_busy(cs)) {
 		DBusMessage *reply = __ofono_error_busy(msg);
 		g_dbus_send_message(conn, reply);
 
@@ -699,7 +699,7 @@ static gboolean clir_ss_control(int type,
 	if (strcmp(sc, "31"))
 		return FALSE;
 
-	if (cs->pending) {
+	if (__ofono_call_settings_is_busy(cs)) {
 		DBusMessage *reply = __ofono_error_busy(msg);
 		g_dbus_send_message(conn, reply);
 
@@ -955,7 +955,7 @@ static DBusMessage *cs_get_properties(DBusConnection *conn, DBusMessage *msg,
 {
 	struct ofono_call_settings *cs = data;
 
-	if (cs->pending || __ofono_ussd_is_busy(cs->ussd))
+	if (__ofono_call_settings_is_busy(cs) || __ofono_ussd_is_busy(cs->ussd))
 		return __ofono_error_busy(msg);
 
 	if (cs->flags & CALL_SETTINGS_FLAG_CACHED)
@@ -976,7 +976,7 @@ static void clir_set_query_callback(const struct ofono_error *error,
 	struct ofono_call_settings *cs = data;
 	DBusMessage *reply;
 
-	if (!cs->pending)
+	if (!__ofono_call_settings_is_busy(cs))
 		return;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
@@ -1132,7 +1132,7 @@ static DBusMessage *cs_set_property(DBusConnection *conn, DBusMessage *msg,
 	const char *property;
 	int cls;
 
-	if (cs->pending || __ofono_ussd_is_busy(cs->ussd))
+	if (__ofono_call_settings_is_busy(cs) || __ofono_ussd_is_busy(cs->ussd))
 		return __ofono_error_busy(msg);
 
 	if (!dbus_message_iter_init(msg, &iter))
-- 
1.7.2.3


  parent reply	other threads:[~2010-09-21 10:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-21 10:21 [PATCH 0/5] Patch Description Yang Gu
2010-09-21 10:21 ` [PATCH 1/5] Add macro for general result and additional info Yang Gu
2010-09-27  0:47   ` Denis Kenzior
2010-09-21 10:21 ` [PATCH 2/5] stk: Support send ss response Yang Gu
2010-09-27  0:48   ` Denis Kenzior
2010-10-18  8:04     ` Gu, Yang
2010-10-18 17:30       ` andrzej zaborowski
2010-10-18 22:34         ` Denis Kenzior
2010-09-21 10:21 ` Yang Gu [this message]
2010-09-27  1:05   ` [PATCH 3/5] ss: Use function to judge if it's busy Denis Kenzior
2010-09-21 10:21 ` [PATCH 4/5] ss: Use errno for ssc handling functions Yang Gu
2010-09-27  1:01   ` Denis Kenzior
2010-09-21 10:21 ` [PATCH 5/5] cf: Handle send ss proactive command Yang Gu
2010-09-21 19:28   ` Jeevaka.Badrappan
2010-09-27  2:11     ` Gu, Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285064479-12907-4-git-send-email-yang.gu@intel.com \
    --to=yang.gu@intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.