* [PATCH_v0 0/3] cdma-connman add roaming support
@ 2011-12-01 16:40 Guillaume Zajac
2011-12-01 16:40 ` [PATCH_v0 1/3] doc: Add RoamingAllowed property Guillaume Zajac
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Guillaume Zajac @ 2011-12-01 16:40 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 725 bytes --]
Hi,
Those 3 patches are implementing roaming property support.
It contains the cdma-netreg status watches implementation, to notify
cdma connection manager that network status has changed to disable or not
data call in case roaming is allowed or not.
Kind regards,
Guillaume
Guillaume Zajac (3):
doc: Add RoamingAllowed property
cdma-netreg: Add cdma-netreg status watch
cdma-connman: Add RoamingAllowed support
doc/cdma-connman-api.txt | 8 +++++
src/cdma-connman.c | 70 +++++++++++++++++++++++++++++++++++++++++++++-
src/cdma-netreg.c | 52 ++++++++++++++++++++++++++++++++++
src/ofono.h | 13 ++++++++
4 files changed, 142 insertions(+), 1 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH_v0 1/3] doc: Add RoamingAllowed property 2011-12-01 16:40 [PATCH_v0 0/3] cdma-connman add roaming support Guillaume Zajac @ 2011-12-01 16:40 ` Guillaume Zajac 2011-11-29 17:40 ` Denis Kenzior 2011-12-01 16:40 ` [PATCH_v0 2/3] cdma-netreg: Add cdma-netreg status watch Guillaume Zajac 2011-12-01 16:40 ` [PATCH_v0 3/3] cdma-connman: Add RoamingAllowed support Guillaume Zajac 2 siblings, 1 reply; 8+ messages in thread From: Guillaume Zajac @ 2011-12-01 16:40 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 800 bytes --] --- doc/cdma-connman-api.txt | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/doc/cdma-connman-api.txt b/doc/cdma-connman-api.txt index 48699a3..319c973 100644 --- a/doc/cdma-connman-api.txt +++ b/doc/cdma-connman-api.txt @@ -45,6 +45,14 @@ Properties boolean Powered [readwrite] Holds the password to be used for authentication purposes. + boolean RoamingAllowed [readwrite] + + Contains whether data roaming is allowed. In the off + setting, if the packet radio registration state + indicates that the modem is roaming, oFono will + automatically shutdown connection and no further + connection establishment will be possible. + dict Settings [readonly, optional] Holds all the IP network settings -- 1.7.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH_v0 1/3] doc: Add RoamingAllowed property 2011-12-01 16:40 ` [PATCH_v0 1/3] doc: Add RoamingAllowed property Guillaume Zajac @ 2011-11-29 17:40 ` Denis Kenzior 2011-12-02 8:48 ` Aygon, Bertrand 2011-12-02 10:09 ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont 0 siblings, 2 replies; 8+ messages in thread From: Denis Kenzior @ 2011-11-29 17:40 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 954 bytes --] Hi Guillaume, On 12/01/2011 10:40 AM, Guillaume Zajac wrote: > --- > doc/cdma-connman-api.txt | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/doc/cdma-connman-api.txt b/doc/cdma-connman-api.txt > index 48699a3..319c973 100644 > --- a/doc/cdma-connman-api.txt > +++ b/doc/cdma-connman-api.txt > @@ -45,6 +45,14 @@ Properties boolean Powered [readwrite] > Holds the password to be used for authentication > purposes. > > + boolean RoamingAllowed [readwrite] > + > + Contains whether data roaming is allowed. In the off > + setting, if the packet radio registration state > + indicates that the modem is roaming, oFono will > + automatically shutdown connection and no further > + connection establishment will be possible. > + I'm still not convinced this is really needed. Can you discuss a specific usecase you are trying to take care of here? Regards, -Denis ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH_v0 1/3] doc: Add RoamingAllowed property 2011-11-29 17:40 ` Denis Kenzior @ 2011-12-02 8:48 ` Aygon, Bertrand 2011-12-02 10:09 ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont 1 sibling, 0 replies; 8+ messages in thread From: Aygon, Bertrand @ 2011-12-02 8:48 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1373 bytes --] Hi Denis, > > + boolean RoamingAllowed [readwrite] > > + > > + Contains whether data roaming is allowed. In the off > > + setting, if the packet radio registration state > > + indicates that the modem is roaming, oFono will > > + automatically shutdown connection and no further > > + connection establishment will be possible. > > + > > I'm still not convinced this is really needed. Can you discuss a specific usecase > you are trying to take care of here? This is the same use case as with GSM/3G network. During our testing in Indonesia, we have seen some situation where we were in roaming mode. So roaming mode is supported in CDMA, and I guess that this would have incidence on the billing (I will try to get some confirmation about this). Regards, Bertrand --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH_v0 1/3] doc: Add RoamingAllowed property 2011-11-29 17:40 ` Denis Kenzior 2011-12-02 8:48 ` Aygon, Bertrand @ 2011-12-02 10:09 ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont 2011-12-02 10:54 ` Aygon, Bertrand 1 sibling, 1 reply; 8+ messages in thread From: =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont @ 2011-12-02 10:09 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 809 bytes --] Le Mardi 29 Novembre 2011 11:40:39 ext Denis Kenzior a écrit : > > + boolean RoamingAllowed [readwrite] > > + > > + Contains whether data roaming is allowed. In the off > > + setting, if the packet radio registration state > > + indicates that the modem is roaming, oFono will > > + automatically shutdown connection and no further > > + connection establishment will be possible. > > + > > I'm still not convinced this is really needed. Can you discuss a > specific usecase you are trying to take care of here? I do not know CDMA but I do not see why this would be needed at all at the ConnectionManager atom level. If this is about pricing, it should probably be a per-context property instead, both for CDMA and GSM. -- Rémi Denis-Courmont http://www.remlab.net/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH_v0 1/3] doc: Add RoamingAllowed property 2011-12-02 10:09 ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont @ 2011-12-02 10:54 ` Aygon, Bertrand 0 siblings, 0 replies; 8+ messages in thread From: Aygon, Bertrand @ 2011-12-02 10:54 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1814 bytes --] Hi, > > > + boolean RoamingAllowed [readwrite] > > > + > > > + Contains whether data roaming is allowed. In the off > > > + setting, if the packet radio registration state > > > + indicates that the modem is roaming, oFono will > > > + automatically shutdown connection and no further > > > + connection establishment will be possible. > > > + > > > > I'm still not convinced this is really needed. Can you discuss a > > specific usecase you are trying to take care of here? > > I do not know CDMA but I do not see why this would be needed at all at the > ConnectionManager atom level. If this is about pricing, it should probably be a > per-context property instead, both for CDMA and GSM. There is a RoamingAllowed property in the connman atom, and this property is used to set if the user want to do some data call while in roaming mode. Some months ago has been introduced a cdma-connman atom, but currently, there is no RoamingAllowed property in this version. The goal of this patch is to add the same property, so when doing a CDMA data call, if we are in roaming, we can check if the user still want to do the data call or not. In CDMA, there is no context as in GSM. Regards, Bertrand --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH_v0 2/3] cdma-netreg: Add cdma-netreg status watch 2011-12-01 16:40 [PATCH_v0 0/3] cdma-connman add roaming support Guillaume Zajac 2011-12-01 16:40 ` [PATCH_v0 1/3] doc: Add RoamingAllowed property Guillaume Zajac @ 2011-12-01 16:40 ` Guillaume Zajac 2011-12-01 16:40 ` [PATCH_v0 3/3] cdma-connman: Add RoamingAllowed support Guillaume Zajac 2 siblings, 0 replies; 8+ messages in thread From: Guillaume Zajac @ 2011-12-01 16:40 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 3228 bytes --] --- src/cdma-netreg.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/ofono.h | 13 +++++++++++++ 2 files changed, 65 insertions(+), 0 deletions(-) diff --git a/src/cdma-netreg.c b/src/cdma-netreg.c index 222c3b7..34c11c0 100644 --- a/src/cdma-netreg.c +++ b/src/cdma-netreg.c @@ -35,6 +35,7 @@ struct ofono_cdma_netreg { enum cdma_netreg_status status; int strength; int hdr_strength; + struct ofono_watchlist *status_watches; const struct ofono_cdma_netreg_driver *driver; void *driver_data; struct ofono_atom *atom; @@ -104,6 +105,53 @@ static GDBusSignalTable cdma_netreg_manager_signals[] = { { } }; +unsigned int __ofono_cdma_netreg_add_status_watch( + struct ofono_cdma_netreg *netreg, + ofono_cdma_netreg_status_notify_cb_t notify, + void *data, ofono_destroy_func destroy) +{ + struct ofono_watchlist_item *item; + + DBG("%p", netreg); + + if (netreg == NULL) + return 0; + + if (notify == NULL) + return 0; + + item = g_new0(struct ofono_watchlist_item, 1); + + item->notify = notify; + item->destroy = destroy; + item->notify_data = data; + + return __ofono_watchlist_add_item(netreg->status_watches, item); +} + +gboolean __ofono_cdma_netreg_remove_status_watch( + struct ofono_cdma_netreg *netreg, + unsigned int id) +{ + DBG("%p", netreg); + + return __ofono_watchlist_remove_item(netreg->status_watches, id); +} + +static void notify_status_watches(struct ofono_cdma_netreg *netreg) +{ + struct ofono_watchlist_item *item; + GSList *l; + ofono_cdma_netreg_status_notify_cb_t notify; + + for (l = netreg->status_watches->items; l; l = l->next) { + item = l->data; + notify = item->notify; + + notify(item->notify_data); + } +} + static void serving_system_callback(const struct ofono_error *error, const char *sid, void *data) { @@ -120,6 +168,8 @@ static void serving_system_callback(const struct ofono_error *error, } DBG("Serving system Identifier: %s", sid); + + notify_status_watches(cdma_netreg); } static void set_registration_status(struct ofono_cdma_netreg *cdma_netreg, @@ -152,6 +202,8 @@ void ofono_cdma_netreg_status_notify(struct ofono_cdma_netreg *cdma_netreg, if (cdma_netreg->status != status) set_registration_status(cdma_netreg, status); + + notify_status_watches(cdma_netreg); } static void strength_notify_common(struct ofono_cdma_netreg *netreg, diff --git a/src/ofono.h b/src/ofono.h index bfb534d..37b2b3f 100644 --- a/src/ofono.h +++ b/src/ofono.h @@ -492,3 +492,16 @@ void __ofono_gprs_provision_free_settings( void __ofono_private_network_release(int id); ofono_bool_t __ofono_private_network_request(ofono_private_network_cb_t cb, int *id, void *data); + +#include <ofono/cdma-netreg.h> + +typedef void (*ofono_cdma_netreg_status_notify_cb_t)(void *data); + +unsigned int __ofono_cdma_netreg_add_status_watch( + struct ofono_cdma_netreg *netreg, + ofono_cdma_netreg_status_notify_cb_t cb, + void *data, ofono_destroy_func destroy); + +gboolean __ofono_cdma_netreg_remove_status_watch( + struct ofono_cdma_netreg *netreg, + unsigned int id); -- 1.7.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH_v0 3/3] cdma-connman: Add RoamingAllowed support 2011-12-01 16:40 [PATCH_v0 0/3] cdma-connman add roaming support Guillaume Zajac 2011-12-01 16:40 ` [PATCH_v0 1/3] doc: Add RoamingAllowed property Guillaume Zajac 2011-12-01 16:40 ` [PATCH_v0 2/3] cdma-netreg: Add cdma-netreg status watch Guillaume Zajac @ 2011-12-01 16:40 ` Guillaume Zajac 2 siblings, 0 replies; 8+ messages in thread From: Guillaume Zajac @ 2011-12-01 16:40 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 4471 bytes --] We need to use status watch in case we are registered to a network and we pass into roaming status. We have to deactivate the data call. --- src/cdma-connman.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 69 insertions(+), 1 deletions(-) diff --git a/src/cdma-connman.c b/src/cdma-connman.c index 87cefd6..34c2d24 100644 --- a/src/cdma-connman.c +++ b/src/cdma-connman.c @@ -52,6 +52,10 @@ struct cdma_connman_settings { struct ofono_cdma_connman { ofono_bool_t powered; ofono_bool_t dormant; + ofono_bool_t roaming_allowed; + struct ofono_cdma_netreg *cdma_netreg; + unsigned int cdma_netreg_watch; + unsigned int status_watch; struct cdma_connman_settings *settings; DBusMessage *pending; const struct ofono_cdma_connman_driver *driver; @@ -354,8 +358,10 @@ static ofono_bool_t network_registered(struct ofono_cdma_connman *cm) switch (status) { case NETWORK_REGISTRATION_STATUS_REGISTERED: - case NETWORK_REGISTRATION_STATUS_ROAMING: return TRUE; + case NETWORK_REGISTRATION_STATUS_ROAMING: + if (cm->roaming_allowed == TRUE) + return TRUE; default: break; } @@ -390,6 +396,10 @@ static DBusMessage *cdma_connman_get_properties(DBusConnection *conn, value = cm->dormant; ofono_dbus_dict_append(&dict, "Dormant", DBUS_TYPE_BOOLEAN, &value); + value = cm->roaming_allowed; + ofono_dbus_dict_append(&dict, "RoamingAllowed", + DBUS_TYPE_BOOLEAN, &value); + if (cm->settings) cdma_connman_settings_append_properties(cm, &dict); @@ -512,6 +522,19 @@ static DBusMessage *cdma_connman_set_property(DBusConnection *conn, dbus_message_iter_get_basic(&var, &str); return cdma_connman_set_password(cm, conn, msg, str); + } else if (!strcmp(property, "RoamingAllowed")) { + if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&var, &value); + + if (cm->roaming_allowed == (ofono_bool_t) value) + return dbus_message_new_method_return(msg); + + cm->roaming_allowed = value; + + if (network_registered(cm) == FALSE && cm->powered == TRUE) + cm->driver->deactivate(cm, deactivate_callback, cm); } /* TODO: Dormant property. Not yet supported. */ @@ -575,11 +598,24 @@ void ofono_cdma_connman_deactivated(struct ofono_cdma_connman *cm) static void cdma_connman_unregister(struct ofono_atom *atom) { DBusConnection *conn = ofono_dbus_get_connection(); + struct ofono_cdma_connman *cm = __ofono_atom_get_data(atom); struct ofono_modem *modem = __ofono_atom_get_modem(atom); const char *path = __ofono_atom_get_path(atom); DBG(""); + if (cm->cdma_netreg_watch) { + if (cm->status_watch) { + __ofono_cdma_netreg_remove_status_watch(cm->cdma_netreg, + cm->status_watch); + cm->status_watch = 0; + } + + __ofono_modem_remove_atom_watch(modem, cm->cdma_netreg_watch); + cm->cdma_netreg_watch = 0; + cm->cdma_netreg = NULL; + } + g_dbus_unregister_interface(conn, path, OFONO_CDMA_CONNECTION_MANAGER_INTERFACE); ofono_modem_remove_interface(modem, @@ -639,6 +675,34 @@ struct ofono_cdma_connman *ofono_cdma_connman_create( return cm; } +static void cdma_netreg_status_changed(void *data) +{ + struct ofono_cdma_connman *cm = data; + + DBG(""); + + if (network_registered(cm) == FALSE && cm->powered == TRUE) + cm->driver->deactivate(cm, deactivate_callback, cm); +} + +static void cdma_netreg_watch(struct ofono_atom *atom, + enum ofono_atom_watch_condition cond, + void *data) +{ + struct ofono_cdma_connman *cm = data; + + if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) { + cm->cdma_netreg = NULL; + return; + } + + cm->cdma_netreg = __ofono_atom_get_data(atom); + cm->status_watch = __ofono_cdma_netreg_add_status_watch( + cm->cdma_netreg, + cdma_netreg_status_changed, cm, + NULL); +} + void ofono_cdma_connman_register(struct ofono_cdma_connman *cm) { DBusConnection *conn = ofono_dbus_get_connection(); @@ -659,6 +723,10 @@ void ofono_cdma_connman_register(struct ofono_cdma_connman *cm) ofono_modem_add_interface(modem, OFONO_CDMA_CONNECTION_MANAGER_INTERFACE); + cm->cdma_netreg_watch = __ofono_modem_add_atom_watch(modem, + OFONO_ATOM_TYPE_CDMA_NETREG, + cdma_netreg_watch, cm, NULL); + __ofono_atom_register(cm->atom, cdma_connman_unregister); } -- 1.7.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-12-02 10:54 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-12-01 16:40 [PATCH_v0 0/3] cdma-connman add roaming support Guillaume Zajac 2011-12-01 16:40 ` [PATCH_v0 1/3] doc: Add RoamingAllowed property Guillaume Zajac 2011-11-29 17:40 ` Denis Kenzior 2011-12-02 8:48 ` Aygon, Bertrand 2011-12-02 10:09 ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont 2011-12-02 10:54 ` Aygon, Bertrand 2011-12-01 16:40 ` [PATCH_v0 2/3] cdma-netreg: Add cdma-netreg status watch Guillaume Zajac 2011-12-01 16:40 ` [PATCH_v0 3/3] cdma-connman: Add RoamingAllowed support Guillaume Zajac
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.