All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dragos Tatulea <dragos@endocode.com>
To: ofono@ofono.org
Subject: [PATCH] gprs: assume attached state when registered on LTE
Date: Mon, 21 Mar 2016 16:55:31 +0100	[thread overview]
Message-ID: <1458575731-30914-1-git-send-email-dragos@endocode.com> (raw)

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

LTE doesn't really use the concept of an attached state. However,
the oFono API needs it. ConnMan needs it as well.
---
 src/gprs.c | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index 9a85121..3acb412 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1585,12 +1585,27 @@ static void release_active_contexts(struct ofono_gprs *gprs)
 	}
 }
 
-static void gprs_attached_update(struct ofono_gprs *gprs)
+static void gprs_set_attached_property(struct ofono_gprs *gprs,
+					ofono_bool_t attached)
 {
-	DBusConnection *conn = ofono_dbus_get_connection();
 	const char *path;
+	DBusConnection *conn = ofono_dbus_get_connection();
+	dbus_bool_t value = attached;
+
+	if (gprs->attached == attached)
+		return;
+
+	gprs->attached = attached;
+
+	path = __ofono_atom_get_path(gprs->atom);
+	ofono_dbus_signal_property_changed(conn, path,
+				OFONO_CONNECTION_MANAGER_INTERFACE,
+				"Attached", DBUS_TYPE_BOOLEAN, &value);
+}
+
+static void gprs_attached_update(struct ofono_gprs *gprs)
+{
 	ofono_bool_t attached;
-	dbus_bool_t value;
 
 	attached = gprs->driver_attached &&
 		(gprs->status == NETWORK_REGISTRATION_STATUS_REGISTERED ||
@@ -1613,13 +1628,7 @@ static void gprs_attached_update(struct ofono_gprs *gprs)
 		return;
 	}
 
-	gprs->attached = attached;
-
-	path = __ofono_atom_get_path(gprs->atom);
-	value = attached;
-	ofono_dbus_signal_property_changed(conn, path,
-				OFONO_CONNECTION_MANAGER_INTERFACE,
-				"Attached", DBUS_TYPE_BOOLEAN, &value);
+	gprs_set_attached_property(gprs, attached);
 }
 
 static void registration_status_cb(const struct ofono_error *error,
@@ -1690,6 +1699,13 @@ static void gprs_netreg_update(struct ofono_gprs *gprs)
 
 	DBG("attach: %u, driver_attached: %u", attach, gprs->driver_attached);
 
+	if (ofono_netreg_get_technology(gprs->netreg) ==
+			ACCESS_TECHNOLOGY_EUTRAN) {
+		/* Ignore attach logic for LTE. There is no such concept. */
+		gprs_set_attached_property(gprs, attach);
+		return;
+	}
+
 	if (gprs->driver_attached == attach)
 		return;
 
-- 
2.5.5


             reply	other threads:[~2016-03-21 15:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 15:55 Dragos Tatulea [this message]
2016-03-21 16:00 ` [PATCH] gprs: assume attached state when registered on LTE Denis Kenzior

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=1458575731-30914-1-git-send-email-dragos@endocode.com \
    --to=dragos@endocode.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.