RE: [PATCH] Check if ussd is busy when doing ss

2010-09-14 Thread Gu, Yang
Hi, 


-Original Message-
From: ofono-boun...@ofono.org [mailto:ofono-boun...@ofono.org] On Behalf Of
Pekka Pessi
Sent: Monday, September 13, 2010 9:19 PM
To: ofono@ofono.org
Subject: Re: [PATCH] Check if ussd is busy when doing ss

Hi Yang,

2010/9/6 Yang Gu yang...@intel.com:
 It's still not clear how ss and ussd interfere with each other. Current
 decision is each ss (call-barring, call-forwarding, etc.) has
 interference with ussd, but there is no interference within these ss.
 That is, call-barring has interference with ussd, but call-barring has
 no interference with call-forwarding.

There is only one signaling channel for the supplementary services.
Only one supplementary service operation can be active at a time. (Or
two, network can initiate ussd notify or request while
mobile-originated ussd is pending.)

Thank you for the info. When you say only one MO ss operation can be active at 
a time, do you mean modem will serialize them or oFono needs always to take 
care, or it's hardware specific?


Regards,
-Yang
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] Check if ussd is busy when doing ss

2010-09-13 Thread Pekka Pessi
Hi Yang,

2010/9/6 Yang Gu yang...@intel.com:
 It's still not clear how ss and ussd interfere with each other. Current
 decision is each ss (call-barring, call-forwarding, etc.) has
 interference with ussd, but there is no interference within these ss.
 That is, call-barring has interference with ussd, but call-barring has
 no interference with call-forwarding.

There is only one signaling channel for the supplementary services.
Only one supplementary service operation can be active at a time. (Or
two, network can initiate ussd notify or request while
mobile-originated ussd is pending.)

-- 
Pekka.Pessi mail at nokia.com
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


RE: [PATCH] Check if ussd is busy when doing ss

2010-09-10 Thread Gu, Yang
Hi Denis,


-Original Message-
From: Denis Kenzior [mailto:denk...@gmail.com]
Sent: Thursday, September 09, 2010 10:07 PM
To: ofono@ofono.org
Cc: Gu, Yang
Subject: Re: [PATCH] Check if ussd is busy when doing ss

Hi Yang,

On 09/05/2010 09:19 PM, Yang Gu wrote:
 It's still not clear how ss and ussd interfere with each other. Current
 decision is each ss (call-barring, call-forwarding, etc.) has
 interference with ussd, but there is no interference within these ss.
 That is, call-barring has interference with ussd, but call-barring has
 no interference with call-forwarding.

Patch has been applied, but I broke it up into four patches.

Are you planning to take care of cb_ss_control, cb_ss_password,
cf_ss_control and cs_ss_control busy conditions separately?


I'm not following your question. We already check if ussd is busy at the 
beginning of ussd_initiate(), so these functions are ok with necessary checks. 
On the other hand, I think we need also check if either of these supplementary 
services (call barring, call forwarding and call settings) is busy when doing a 
real unstructured supplementary service (ussd_initiate(),ussd_respond(), etc.). 


Regards,
-Yang
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] Check if ussd is busy when doing ss

2010-09-09 Thread Denis Kenzior
Hi Yang,

On 09/05/2010 09:19 PM, Yang Gu wrote:
 It's still not clear how ss and ussd interfere with each other. Current
 decision is each ss (call-barring, call-forwarding, etc.) has
 interference with ussd, but there is no interference within these ss.
 That is, call-barring has interference with ussd, but call-barring has
 no interference with call-forwarding.

Patch has been applied, but I broke it up into four patches.

Are you planning to take care of cb_ss_control, cb_ss_password,
cf_ss_control and cs_ss_control busy conditions separately?

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] Check if ussd is busy when doing ss

2010-09-05 Thread Yang Gu
It's still not clear how ss and ussd interfere with each other. Current
decision is each ss (call-barring, call-forwarding, etc.) has
interference with ussd, but there is no interference within these ss.
That is, call-barring has interference with ussd, but call-barring has
no interference with call-forwarding.
---
 src/call-barring.c|8 
 src/call-forwarding.c |6 +++---
 src/call-settings.c   |4 ++--
 src/ofono.h   |1 +
 src/ussd.c|   11 +++
 5 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/call-barring.c b/src/call-barring.c
index 7607f3f..a8bb3bd 100644
--- a/src/call-barring.c
+++ b/src/call-barring.c
@@ -669,7 +669,7 @@ static DBusMessage *cb_get_properties(DBusConnection *conn, 
DBusMessage *msg,
 {
struct ofono_call_barring *cb = data;
 
-   if (cb-pending)
+   if (cb-pending || __ofono_ussd_is_busy(cb-ussd))
return __ofono_error_busy(msg);
 
if (!cb-driver-query)
@@ -822,7 +822,7 @@ static DBusMessage *cb_set_property(DBusConnection *conn, 
DBusMessage *msg,
int cls;
int mode;
 
-   if (cb-pending)
+   if (cb-pending || __ofono_ussd_is_busy(cb-ussd))
return __ofono_error_busy(msg);
 
if (!dbus_message_iter_init(msg, iter))
@@ -894,7 +894,7 @@ static DBusMessage *cb_disable_all(DBusConnection *conn, 
DBusMessage *msg,
if (!cb-driver-set)
return __ofono_error_not_implemented(msg);
 
-   if (cb-pending)
+   if (cb-pending || __ofono_ussd_is_busy(cb-ussd))
return __ofono_error_busy(msg);
 
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, passwd,
@@ -941,7 +941,7 @@ static DBusMessage *cb_set_passwd(DBusConnection *conn, 
DBusMessage *msg,
if (!cb-driver-set_passwd)
return __ofono_error_not_implemented(msg);
 
-   if (cb-pending)
+   if (cb-pending || __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 4e77144..c8a79b1 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -430,7 +430,7 @@ static DBusMessage *cf_get_properties(DBusConnection *conn, 
DBusMessage *msg,
if (!cf-driver-query)
return __ofono_error_not_implemented(msg);
 
-   if (cf-pending)
+   if (cf-pending || __ofono_ussd_is_busy(cf-ussd))
return __ofono_error_busy(msg);
 
cf-pending = dbus_message_ref(msg);
@@ -586,7 +586,7 @@ static DBusMessage *cf_set_property(DBusConnection *conn, 
DBusMessage *msg,
int cls;
int type;
 
-   if (cf-pending)
+   if (cf-pending || __ofono_ussd_is_busy(cf-ussd))
return __ofono_error_busy(msg);
 
if (!dbus_message_iter_init(msg, iter))
@@ -704,7 +704,7 @@ static DBusMessage *cf_disable_all(DBusConnection *conn, 
DBusMessage *msg,
if (!cf-driver-erasure)
return __ofono_error_not_implemented(msg);
 
-   if (cf-pending)
+   if (cf-pending || __ofono_ussd_is_busy(cf-ussd))
return __ofono_error_busy(msg);
 
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, strtype,
diff --git a/src/call-settings.c b/src/call-settings.c
index ab20062..ef96345 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -950,7 +950,7 @@ static DBusMessage *cs_get_properties(DBusConnection *conn, 
DBusMessage *msg,
 {
struct ofono_call_settings *cs = data;
 
-   if (cs-pending)
+   if (cs-pending || __ofono_ussd_is_busy(cs-ussd))
return __ofono_error_busy(msg);
 
if (cs-flags  CALL_SETTINGS_FLAG_CACHED)
@@ -1127,7 +1127,7 @@ static DBusMessage *cs_set_property(DBusConnection *conn, 
DBusMessage *msg,
const char *property;
int cls;
 
-   if (cs-pending)
+   if (cs-pending || __ofono_ussd_is_busy(cs-ussd))
return __ofono_error_busy(msg);
 
if (!dbus_message_iter_init(msg, iter))
diff --git a/src/ofono.h b/src/ofono.h
index d95f2f2..9b2e53f 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -254,6 +254,7 @@ gboolean __ofono_ussd_passwd_register(struct ofono_ussd 
*ussd, const char *sc,
ofono_ussd_passwd_cb_t cb, void *data,
ofono_destroy_func destroy);
 void __ofono_ussd_passwd_unregister(struct ofono_ussd *ussd, const char *sc);
+gboolean __ofono_ussd_is_busy(struct ofono_ussd *ussd);
 
 #include ofono/netreg.h
 
diff --git a/src/ussd.c b/src/ussd.c
index 825d560..fbb07d2 100644
--- a/src/ussd.c
+++ b/src/ussd.c
@@ -65,6 +65,17 @@ struct ssc_entry {
ofono_destroy_func destroy;
 };
 
+gboolean __ofono_ussd_is_busy(struct ofono_ussd *ussd)
+{
+   if (!ussd)
+   return FALSE;
+
+   if (ussd-pending || ussd-state != USSD_STATE_IDLE)
+   return