Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. [PATCH 4/7] ofono: implementation of simultaneous APNS
(Mylene JOSSERAND)
2. [PATCH 5/7] ofono: remove the context struct in modem one
(Mylene JOSSERAND)
3. [PATCH 6/7] ofono: add array parsing when contexts are added
(Mylene JOSSERAND)
4. [PATCH 7/7] ofono: set "powered" property according to value
(Mylene JOSSERAND)
5. Equivalent to wpa_supplicant's freq_list? (Mike Purvis)
----------------------------------------------------------------------
Message: 1
Date: Fri, 11 Dec 2015 00:08:01 +0100
From: Mylene JOSSERAND <[email protected]>
To: [email protected]
Subject: [PATCH 4/7] ofono: implementation of simultaneous APNS
Message-ID:
<7999829768ec47556ff70d6239ef8c41599cd96f.1449758613.git.josserand.myl...@gmail.com>
This patch implements the use of simultaneous APNS (and so internet contexts).
It removes the restriction about one Internet context per modem and
inverts the logic of the GetContexts function reply (which exited on first
context).
---
plugins/ofono.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 7f2d677..5b3bf0d 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1172,14 +1172,6 @@ static int add_cm_context(struct modem_data *modem,
const char *context_path,
DBG("%s context path %s", modem->path, context_path);
- if (modem->context) {
- /*
- * We have already assigned a context to this modem
- * and we do only support one Internet context.
- */
- return -EALREADY;
- }
-
context = network_context_alloc(context_path);
if (!context)
return -ENOMEM;
@@ -1438,7 +1430,7 @@ static void cm_get_contexts_reply(DBusPendingCall *call,
void *user_data)
dbus_message_iter_next(&entry);
dbus_message_iter_recurse(&entry, &value);
- if (add_cm_context(modem, context_path, &value) == 0)
+ if (add_cm_context(modem, context_path, &value))
break;
dbus_message_iter_next(&dict);
--
2.1.4
------------------------------
Message: 2
Date: Fri, 11 Dec 2015 00:08:02 +0100
From: Mylene JOSSERAND <[email protected]>
To: [email protected]
Subject: [PATCH 5/7] ofono: remove the context struct in modem one
Message-ID:
<e89b101e4a17c77f8f55513414991e4a2e593e60.1449758613.git.josserand.myl...@gmail.com>
The current commit removes the context structure of the modem one
to use only the list of contexts.
---
plugins/ofono.c | 41 +++++++++++++++++++++++------------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 5b3bf0d..48eb15a 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -152,7 +152,6 @@ struct modem_data {
struct connman_device *device;
- struct network_context *context;
GSList *context_list;
/* Modem Interface */
@@ -669,10 +668,16 @@ static void cdma_cm_set_powered_reply(struct modem_data
*modem,
static int cdma_cm_set_powered(struct modem_data *modem, dbus_bool_t powered)
{
int err;
+ struct network_context *context = NULL;
+
+ if (!modem->context_list)
+ return -1;
DBG("%s powered %d", modem->path, powered);
- err = set_property(modem, modem->context, modem->path,
+ /* In case of CDMA, there is only one context */
+ context = modem->context_list->data;
+ err = set_property(modem, context, modem->path,
OFONO_CDMA_CM_INTERFACE,
"Powered", DBUS_TYPE_BOOLEAN,
&powered,
@@ -1232,7 +1237,6 @@ static int add_cm_context(struct modem_data *modem, const
char *context_path,
if (ip_protocol)
set_context_ipconfig(context, ip_protocol);
- modem->context = context;
context->active = active;
modem->context_list = g_slist_prepend(modem->context_list, context);
@@ -1248,8 +1252,6 @@ static int add_cm_context(struct modem_data *modem, const
char *context_path,
static void remove_cm_context(struct modem_data *modem,
struct network_context *context)
{
- if (!modem->context)
- return;
if (!modem->context_list)
return;
if (!context)
@@ -1261,8 +1263,8 @@ static void remove_cm_context(struct modem_data *modem,
remove_network(modem, context);
modem->context_list = g_slist_remove(modem->context_list, context);
- network_context_free(modem->context);
- modem->context = NULL;
+ network_context_free(context);
+ context = NULL;
}
static void remove_all_contexts(struct modem_data *modem)
@@ -1330,11 +1332,11 @@ static gboolean context_changed(DBusConnection *conn,
if (g_str_equal(key, "Settings")) {
DBG("%s Settings", modem->path);
- extract_ipv4_settings(&value, modem->context);
+ extract_ipv4_settings(&value, context);
} else if (g_str_equal(key, "IPv6.Settings")) {
DBG("%s IPv6.Settings", modem->path);
- extract_ipv6_settings(&value, modem->context);
+ extract_ipv6_settings(&value, context);
} else if (g_str_equal(key, "Active")) {
dbus_bool_t active;
@@ -1386,7 +1388,7 @@ static gboolean context_changed(DBusConnection *conn,
dbus_message_iter_get_basic(&value, &ip_protocol);
- set_context_ipconfig(modem->context, ip_protocol);
+ set_context_ipconfig(context, ip_protocol);
}
return TRUE;
@@ -1843,7 +1845,7 @@ static gboolean cdma_netreg_changed(DBusConnection *conn,
if (modem->registered)
add_cdma_network(modem);
else
- remove_network(modem, modem->context);
+ remove_all_networks(modem);
return TRUE;
}
@@ -1878,7 +1880,7 @@ static void cdma_netreg_properties_reply(struct
modem_data *modem,
if (modem->registered)
add_cdma_network(modem);
else
- remove_network(modem, modem->context);
+ remove_all_networks(modem);
}
static int cdma_netreg_get_properties(struct modem_data *modem)
@@ -1898,7 +1900,7 @@ static void cm_update_attached(struct modem_data *modem,
DBG("%s Attached %d", modem->path, modem->attached);
if (!modem->attached) {
- remove_network(modem, modem->context);
+ remove_all_networks(modem);
return;
}
@@ -1959,6 +1961,7 @@ static gboolean cm_changed(DBusConnection *conn,
DBusMessage *message,
static void cdma_cm_update_powered(struct modem_data *modem,
DBusMessageIter *value)
{
+ struct network_context *context = NULL;
dbus_bool_t cdma_cm_powered;
dbus_message_iter_get_basic(value, &cdma_cm_powered);
@@ -1966,13 +1969,15 @@ static void cdma_cm_update_powered(struct modem_data
*modem,
DBG("%s CDMA cm Powered %d", modem->path, modem->cdma_cm_powered);
- if (!modem->context)
+ if (!modem->context_list)
return;
+ /* In case of CDMA, there is only one context */
+ context = modem->context_list->data;
if (modem->cdma_cm_powered)
- set_connected(modem, modem->context);
+ set_connected(modem, context);
else
- set_disconnected(modem->context);
+ set_disconnected(context);
}
static void cdma_cm_update_settings(struct modem_data *modem,
@@ -1980,7 +1985,7 @@ static void cdma_cm_update_settings(struct modem_data
*modem,
{
DBG("%s Settings", modem->path);
- extract_ipv4_settings(value, modem->context);
+ extract_ipv4_settings(value, modem->context_list->data);
}
static gboolean cdma_cm_changed(DBusConnection *conn,
@@ -1995,7 +2000,7 @@ static gboolean cdma_cm_changed(DBusConnection *conn,
if (!modem)
return TRUE;
- if (modem->online && !modem->context)
+ if (modem->online && !modem->context_list)
cdma_netreg_get_properties(modem);
if (!dbus_message_iter_init(message, &iter))
--
2.1.4
------------------------------
Message: 3
Date: Fri, 11 Dec 2015 00:08:03 +0100
From: Mylene JOSSERAND <[email protected]>
To: [email protected]
Subject: [PATCH 6/7] ofono: add array parsing when contexts are added
Message-ID:
<c0c51039f5fd35c74489ec41ad8bda5632948d79.1449758613.git.josserand.myl...@gmail.com>
In the case there are more than one context saved by ofono, the signal
sent is an array and not a dictionary.
This commit implements this case by recursing it of one step.
---
plugins/ofono.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 48eb15a..62a4d02 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1487,7 +1487,7 @@ static gboolean cm_context_added(DBusConnection *conn,
const char *path = dbus_message_get_path(message);
char *context_path;
struct modem_data *modem;
- DBusMessageIter iter, properties;
+ DBusMessageIter iter, properties, dict;
DBG("%s", path);
@@ -1503,6 +1503,13 @@ static gboolean cm_context_added(DBusConnection *conn,
dbus_message_iter_next(&iter);
dbus_message_iter_recurse(&iter, &properties);
+ /* Sometimes, we get an array instead of dict */
+ if (dbus_message_iter_get_arg_type(&properties) == DBUS_TYPE_ARRAY) {
+ /* Must recurse again */
+ dbus_message_iter_recurse(&properties, &dict);
+ if (add_cm_context(modem, context_path, &dict) != 0)
+ return TRUE;
+ }
if (add_cm_context(modem, context_path, &properties) != 0)
return TRUE;
--
2.1.4
------------------------------
Message: 4
Date: Fri, 11 Dec 2015 00:08:04 +0100
From: Mylene JOSSERAND <[email protected]>
To: [email protected]
Subject: [PATCH 7/7] ofono: set "powered" property according to value
Message-ID:
<7e8e3bb94ac525fcc8818bff744452d99d2c7eb9.1449758613.git.josserand.myl...@gmail.com>
The "powered" modem property is set according to new value.
Otherwise, connman forces the modem to always be powered.
---
plugins/ofono.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 62a4d02..ad817eb 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -2315,8 +2315,8 @@ static gboolean modem_changed(DBusConnection *conn,
DBusMessage *message,
DBG("%s Powered %d", modem->path, modem->powered);
- if (!modem->powered)
- modem_set_powered(modem, TRUE);
+ /* Set the powered according to the value */
+ modem_set_powered(modem, powered);
} else if (g_str_equal(key, "Online")) {
dbus_bool_t online;
--
2.1.4
------------------------------
Message: 5
Date: Fri, 11 Dec 2015 14:12:27 -0500
From: Mike Purvis <[email protected]>
To: [email protected]
Subject: Equivalent to wpa_supplicant's freq_list?
Message-ID:
<cacsjt9oddk6omspelauanu4e0kef3jpbi09cszymecrnk38...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Can connman pass through preferred frequencies to the underlying supplicant?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20151211/e0898acc/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 2, Issue 14
**************************************