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. ofono: cellular service disconnect makes it disappear
      (Andr? Draszik)
   2. [PATCH] session: Set allowed_bearers to NULL before reusing
      list (Daryl Nebrich)
   3. Re: ofono: cellular service disconnect makes it disappear
      (Daryl Nebrich)
   4. [PATCH] session: Maintain bearer priority in policy file and
      check for other services when service lost (Daryl Nebrich)


----------------------------------------------------------------------

Message: 1
Date: Thu, 02 Feb 2017 09:49:21 +0000
From: Andr? Draszik <[email protected]>
To: [email protected]
Subject: ofono: cellular service disconnect makes it disappear
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"

Hi,

We're using connman 1.33 & ofono 1.19 to manage cellular connections using a
Telit LE910 modem, and once we disconnect the cellular service using
connman, it completely disappears from connman's list of services (the
cellular technology remains known to connman).

To make the service known to connman again we have to instruct ofono to
disable the modem and re-enable it again.

Is this expected behaviour? I would guess that it isn't, but I am no expert
in this area and would like confirmation one way or another please.

I could imagine this to be an issue in either connman, ofono, or ofono's
modem driver, or even the hardware (modem firmware?). Any thoughts on that?

Do other people see similar behaviour?


Kind Regards,
Andre'



------------------------------

Message: 2
Date: Thu,  2 Feb 2017 09:31:03 -0500
From: Daryl Nebrich <[email protected]>
To: [email protected]
Subject: [PATCH] session: Set allowed_bearers to NULL before reusing
        list
Message-ID: <[email protected]>

Crash when modifying session policy file with connman already running.  Reset 
allowed_bearers list to NULL before reusing.  NULL considered empty list.
---
 src/session.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/session.c b/src/session.c
index b1e9e1b..267477b 100644
--- a/src/session.c
+++ b/src/session.c
@@ -600,6 +600,7 @@ void connman_session_set_default_config(struct 
connman_session_config *config)
        config->ecall = FALSE;
 
        g_slist_free(config->allowed_bearers);
+       config->allowed_bearers = NULL;
        add_default_bearer_types(&config->allowed_bearers);
 }
 
-- 
1.9.1



------------------------------

Message: 3
Date: Thu, 2 Feb 2017 09:45:06 -0500
From: Daryl Nebrich <[email protected]>
To: Andr? Draszik <[email protected]>
Cc: [email protected]
Subject: Re: ofono: cellular service disconnect makes it disappear
Message-ID:
        <CANmGHYt8QG-P1mh-CaUzOJMzCTLrSBuwLxrcNezSt8VGxAhq=a...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

I'm using connman tip, ofono 1.18 with a Telit LE920 modem.  I don't
see the service go away.  When first connected, the cellular service
shows up in connmanctl as *AO or *AR.  After disconnecting it, it's
still listed as *A.  I can then reconnect it.

However, I've made a change to src/config.c in connman to auto-connect
cellular.  This might explain the different behavior I'm seeing.  Not
sure if my change is the right way, but cellular wasn't auto
connecting without it, which is what I need.  When searching the old
forum messages, I recall seeing discussion of changes in cellular
connect behavior.  Not sure of the back story.  I pasted my unofficial
local patch below.

Daryl

Index: connman-9b07d2a/src/config.c
===================================================================
--- connman-9b07d2a.orig/src/config.c    2017-01-22 14:58:49.000000000 -0500
+++ connman-9b07d2a/src/config.c    2017-01-24 15:15:04.559856388 -0500
@@ -1234,10 +1234,13 @@

         break;

+    /* Add support to auto-connect cellular */
+    case CONNMAN_SERVICE_TYPE_CELLULAR:
+        break;
+
     case CONNMAN_SERVICE_TYPE_UNKNOWN:
     case CONNMAN_SERVICE_TYPE_SYSTEM:
     case CONNMAN_SERVICE_TYPE_BLUETOOTH:
-    case CONNMAN_SERVICE_TYPE_CELLULAR:
     case CONNMAN_SERVICE_TYPE_GPS:
     case CONNMAN_SERVICE_TYPE_VPN:
     case CONNMAN_SERVICE_TYPE_P2P:
@@ -1462,7 +1465,8 @@

     if (type != CONNMAN_SERVICE_TYPE_WIFI &&
             type != CONNMAN_SERVICE_TYPE_ETHERNET &&
-            type != CONNMAN_SERVICE_TYPE_GADGET)
+            type != CONNMAN_SERVICE_TYPE_GADGET &&
+            type != CONNMAN_SERVICE_TYPE_CELLULAR)
         return -ENOSYS;

     return find_and_provision_service(service);
@@ -1482,7 +1486,8 @@

     if (type != CONNMAN_SERVICE_TYPE_WIFI &&
             type != CONNMAN_SERVICE_TYPE_ETHERNET &&
-            type != CONNMAN_SERVICE_TYPE_GADGET)
+            type != CONNMAN_SERVICE_TYPE_GADGET &&
+            type != CONNMAN_SERVICE_TYPE_CELLULAR)
         return -ENOSYS;

     config = g_hash_table_lookup(config_table, ident);

On Thu, Feb 2, 2017 at 4:49 AM, Andr? Draszik <[email protected]> wrote:
> Hi,
>
> We're using connman 1.33 & ofono 1.19 to manage cellular connections using a
> Telit LE910 modem, and once we disconnect the cellular service using
> connman, it completely disappears from connman's list of services (the
> cellular technology remains known to connman).
>
> To make the service known to connman again we have to instruct ofono to
> disable the modem and re-enable it again.
>
> Is this expected behaviour? I would guess that it isn't, but I am no expert
> in this area and would like confirmation one way or another please.
>
> I could imagine this to be an issue in either connman, ofono, or ofono's
> modem driver, or even the hardware (modem firmware?). Any thoughts on that?
>
> Do other people see similar behaviour?
>
>
> Kind Regards,
> Andre'
>
> _______________________________________________
> connman mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/connman


------------------------------

Message: 4
Date: Thu,  2 Feb 2017 10:05:57 -0500
From: Daryl Nebrich <[email protected]>
To: [email protected]
Subject: [PATCH] session: Maintain bearer priority in policy file and
        check for other services when service lost
Message-ID: <[email protected]>

The session_policy_local files can have multiple services listed in 
AllowedBearers.
The order was not being maintained by apply_policy_on_bearers().  Reversed loop
order so that the priority order in policy file is maintained.

session_match_service() now checks the priority of a new service before 
switching.

When a session service is lost, handle_service_state_offline() removes the old 
service
but does not check for other available services.  Added call to 
session_activate().
---
 src/session.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/src/session.c b/src/session.c
index 267477b..d40db0f 100644
--- a/src/session.c
+++ b/src/session.c
@@ -686,18 +686,18 @@ static int parse_bearers(DBusMessageIter *iter, GSList 
**list)
        return 0;
 }
 
-static void filter_bearer(GSList *policy_bearers,
-                               enum connman_service_type bearer,
+static void filter_bearer(GSList *bearers,
+                               enum connman_service_type policy,
                                GSList **list)
 {
-       enum connman_service_type policy;
+       enum connman_service_type bearer;
        GSList *it;
 
-       if (!policy_bearers)
+       if (!bearers)
                return;
 
-       for (it = policy_bearers; it; it = it->next) {
-               policy = GPOINTER_TO_INT(it->data);
+       for (it = bearers; it; it = it->next) {
+               bearer = GPOINTER_TO_INT(it->data);
 
                if (policy != bearer)
                        continue;
@@ -710,15 +710,15 @@ static void filter_bearer(GSList *policy_bearers,
 static void apply_policy_on_bearers(GSList *policy_bearers, GSList *bearers,
                                GSList **list)
 {
-       enum connman_service_type bearer;
+       enum connman_service_type policy_bearer;
        GSList *it;
 
        *list = NULL;
 
-       for (it = bearers; it; it = it->next) {
-               bearer = GPOINTER_TO_INT(it->data);
+       for (it = policy_bearers; it; it = it->next) {
+               policy_bearer = GPOINTER_TO_INT(it->data);
 
-               filter_bearer(policy_bearers, bearer, list);
+               filter_bearer(bearers, policy_bearer, list);
        }
 }
 
@@ -1549,15 +1549,24 @@ static bool session_match_service(struct 
connman_session *session,
 {
        enum connman_service_type bearer_type;
        enum connman_service_type service_type;
+       enum connman_service_type current_service_type;
        GSList *list;
 
        if (policy && policy->allowed)
                return policy->allowed(session, service);
 
+       /* Handle multiple bearers and priorities in session policy. */
+       current_service_type = connman_service_get_type(session->service);
+
        for (list = session->info->config.allowed_bearers; list; list = 
list->next) {
                bearer_type = GPOINTER_TO_INT(list->data);
                service_type = connman_service_get_type(service);
 
+               /* Keep using current service if higher priority. */
+               if (bearer_type == current_service_type) {
+                       return false;
+               }
+
                if (bearer_type == service_type)
                        return true;
        }
@@ -1689,6 +1698,9 @@ static void handle_service_state_offline(struct 
connman_service *service,
 
                session->service = NULL;
                update_session_state(session);
+
+               /* Check if another allowed bearer is available. */
+               session_activate(session);
        }
 }
 
-- 
1.9.1



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 16, Issue 2
**************************************

Reply via email to