Skip to contentSkip to conversation

network: allow status' and notifications on eutran networks

PATCH Applied Sean Nyekjaer 2 participants 3 messages Oct 18, 2024 – Oct 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 network: allow status' and notifications on eutran networks

SIMCom A7672E-FASE shows attached on LTE with +CREG <stat> either 6 registered for "SMS only", home network (applicable only when E-UTRAN) 7 registered for "SMS only", roaming (applicable only when <AcT> indicates E-UTRAN)
+COPS supplies the <AcT> = EUTRAN
---
Changes since v1:
- removed switch cases in favor of L_IN_SET

 src/network.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
src/network.c +18 -9
index 40626179..48944219 100644
@@ -376,7 +376,8 @@ static char *get_operator_display_name(struct ofono_netreg *netreg)
 		return name;
 	}
 
-	if (netreg->status == NETWORK_REGISTRATION_STATUS_REGISTERED)
+	if (L_IN_SET(netreg->status, NETWORK_REGISTRATION_STATUS_REGISTERED,
+				NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN))
 		home_or_spdi = TRUE;
 	else
 		home_or_spdi = sim_spdi_lookup(netreg->spdi,
@@ -1205,8 +1206,10 @@ static void current_operator_callback(const struct ofono_error *error,
 	 * in which case the operator information frequently comes in bogus.
 	 * We ignore it here
 	 */
-	if (netreg->status != NETWORK_REGISTRATION_STATUS_REGISTERED &&
-			netreg->status != NETWORK_REGISTRATION_STATUS_ROAMING)
+	if (!L_IN_SET(netreg->status, NETWORK_REGISTRATION_STATUS_REGISTERED,
+				NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN,
+				NETWORK_REGISTRATION_STATUS_ROAMING,
+				NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN))
 		current = NULL;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
@@ -1351,8 +1354,10 @@ void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status,
 	if (netreg->technology != tech)
 		set_registration_technology(netreg, tech);
 
-	if (netreg->status == NETWORK_REGISTRATION_STATUS_REGISTERED ||
-		netreg->status == NETWORK_REGISTRATION_STATUS_ROAMING) {
+	if (L_IN_SET(netreg->status, NETWORK_REGISTRATION_STATUS_REGISTERED,
+				NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN,
+				NETWORK_REGISTRATION_STATUS_ROAMING,
+				NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN)) {
 		if (netreg->driver->current_operator != NULL)
 			netreg->driver->current_operator(netreg,
 					current_operator_callback, netreg);
@@ -1460,8 +1465,10 @@ static void init_registration_status(const struct ofono_error *error,
 	 * Bootstrap our signal strength value without waiting for the
 	 * stack to report it
 	 */
-	if (netreg->status == NETWORK_REGISTRATION_STATUS_REGISTERED ||
-		netreg->status == NETWORK_REGISTRATION_STATUS_ROAMING) {
+	if (L_IN_SET(netreg->status, NETWORK_REGISTRATION_STATUS_REGISTERED,
+				NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN,
+				NETWORK_REGISTRATION_STATUS_ROAMING,
+				NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN)) {
 		if (netreg->driver->strength != NULL)
 			netreg->driver->strength(netreg,
 					signal_strength_callback, netreg);
@@ -1516,8 +1523,10 @@ void ofono_netreg_strength_notify(struct ofono_netreg *netreg, int strength)
 	 * Theoretically we can get signal strength even when not registered
 	 * to any network.  However, what do we do with it in that case?
 	 */
-	if (netreg->status != NETWORK_REGISTRATION_STATUS_REGISTERED &&
-			netreg->status != NETWORK_REGISTRATION_STATUS_ROAMING)
+	if (!L_IN_SET(netreg->status, NETWORK_REGISTRATION_STATUS_REGISTERED,
+				NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN,
+				NETWORK_REGISTRATION_STATUS_ROAMING,
+				NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN))
 		return;
 
 	DBG("strength %d", strength);
Signature · 1 line
2.46.2
#1 lore raw

PATCH v2 2/2 gprs: allow attached updates and status' on eutran networks

SIMCom A7672E-FASE shows attached on LTE with +CREG <stat> either 6 registered for "SMS only", home network (applicable only when E-UTRAN) 7 registered for "SMS only", roaming (applicable only when <AcT> indicates E-UTRAN)
+COPS supplies the <AcT> = EUTRAN
---
Changes since v1:
- removed switch cases in favor of L_IN_SET

 src/gprs.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
src/gprs.c +9 -5
index 46668820..3c71f808 100644
@@ -1627,9 +1627,11 @@ static void gprs_attached_update(struct ofono_gprs *gprs)
 		 */
 		attached = have_active_contexts(gprs);
 	else
-		attached = gprs->driver_attached &&
-			(status == NETWORK_REGISTRATION_STATUS_REGISTERED ||
-				status == NETWORK_REGISTRATION_STATUS_ROAMING);
+		attached = gprs->driver_attached && L_IN_SET(status,
+			NETWORK_REGISTRATION_STATUS_REGISTERED,
+			NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN,
+			NETWORK_REGISTRATION_STATUS_ROAMING,
+			NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN);
 
 	if (attached == gprs->attached)
 		return;
@@ -2637,8 +2639,10 @@ void ofono_gprs_status_notify(struct ofono_gprs *gprs, int status)
 	if (gprs->flags & GPRS_FLAG_ATTACHING)
 		return;
 
-	if (status != NETWORK_REGISTRATION_STATUS_REGISTERED &&
-			status != NETWORK_REGISTRATION_STATUS_ROAMING) {
+	if (!L_IN_SET(status, NETWORK_REGISTRATION_STATUS_REGISTERED,
+				NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN,
+				NETWORK_REGISTRATION_STATUS_ROAMING,
+				NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN)) {
 		ofono_gprs_detached_notify(gprs);
 		return;
 	}
Signature · 1 line
2.46.2
#2 lore raw
In reply to Sean Nyekjaer
This series was applied to ofono.git (master) by Denis Kenzior <[email protected]>:

Hello:

This series was applied to ofono.git (master)
by Denis Kenzior <[email protected]>:

Quoted 10 lines · On Fri, 18 Oct 2024 12:51:44 +0200 you wrote:

SIMCom A7672E-FASE shows attached on LTE with +CREG <stat> either 6 registered for "SMS only", home network (applicable only when E-UTRAN) 7 registered for "SMS only", roaming (applicable only when <AcT> indicates E-UTRAN)
+COPS supplies the <AcT> = EUTRAN
---
Changes since v1:
- removed switch cases in favor of L_IN_SET

[...]

Here is the summary with links:
- [v2,1/2] network: allow status' and notifications on eutran networks

    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=8d1c9dfcb161
  - [v2,2/2] gprs: allow attached updates and status' on eutran networks
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=2cf81c33a02b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html