diff mbox series

[v2,1/2] network: allow status' and notifications on eutran networks

Message ID 20241018105147.1382861-1-sean@geanix.com (mailing list archive)
State Accepted
Commit 8d1c9dfcb161e9dc8d529d409ba558c19e61fe9e
Headers show
Series [v2,1/2] network: allow status' and notifications on eutran networks | expand

Commit Message

Sean Nyekjaer Oct. 18, 2024, 10:51 a.m. UTC
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(-)

Comments

patchwork-bot+ofono@kernel.org Oct. 24, 2024, 2:30 p.m. UTC | #1
Hello:

This series was applied to ofono.git (master)
by Denis Kenzior <denkenz@gmail.com>:

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!
diff mbox series

Patch

diff --git a/src/network.c b/src/network.c
index 40626179..48944219 100644
--- a/src/network.c
+++ b/src/network.c
@@ -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);