Change in osmo-pcu[master]: nacc_fsm: Move logic checking if SI is being waited for to a func helper

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Sep 13 13:31:59 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/25405 )

Change subject: nacc_fsm: Move logic checking if SI is being waited for to a func helper
......................................................................

nacc_fsm: Move logic checking if SI is being waited for to a func helper

We already have a similar function for Neighbor Address Resolution.
This way we keep as much as possible internal state related logic into
the nacc_fsm.c file.

Change-Id: I7378939825cc3ec3280f76bc51233c0a172d8a27
---
M src/gprs_bssgp_rim.c
M src/nacc_fsm.c
M src/nacc_fsm.h
3 files changed, 13 insertions(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve



diff --git a/src/gprs_bssgp_rim.c b/src/gprs_bssgp_rim.c
index c19ed81..f1679a6 100644
--- a/src/gprs_bssgp_rim.c
+++ b/src/gprs_bssgp_rim.c
@@ -158,13 +158,8 @@
 
 	llist_for_each(tmp, bts_ms_list(bts)) {
 		struct GprsMs *ms = llist_entry(tmp, typeof(*ms), list);
-		if (!ms->nacc)
-			continue;
-		if (ms->nacc->fi->state != NACC_ST_WAIT_REQUEST_SI)
-			continue;
-		if (osmo_cgi_ps_cmp(&nacc->reprt_cell, &ms->nacc->cgi_ps) != 0)
-			continue;
-		osmo_fsm_inst_dispatch(ms->nacc->fi, NACC_EV_RX_SI, entry);
+		if (ms->nacc && nacc_fsm_is_waiting_si_resolution(ms->nacc, &nacc->reprt_cell))
+			osmo_fsm_inst_dispatch(ms->nacc->fi, NACC_EV_RX_SI, entry);
 	}
 	return 0;
 }
diff --git a/src/nacc_fsm.c b/src/nacc_fsm.c
index ca226ac..df38927 100644
--- a/src/nacc_fsm.c
+++ b/src/nacc_fsm.c
@@ -887,3 +887,11 @@
 		return false;
 	return neigh_cache_entry_key_eq(&ctx->neigh_key, neigh_key);
 }
+
+bool nacc_fsm_is_waiting_si_resolution(const struct nacc_fsm_ctx *ctx,
+				       const struct osmo_cell_global_id_ps *cgi_ps)
+{
+	if (ctx->fi->state != NACC_ST_WAIT_REQUEST_SI)
+		return false;
+	return !osmo_cgi_ps_cmp(&ctx->cgi_ps, cgi_ps);
+}
diff --git a/src/nacc_fsm.h b/src/nacc_fsm.h
index 04c9ba4..68ebd52 100644
--- a/src/nacc_fsm.h
+++ b/src/nacc_fsm.h
@@ -72,3 +72,6 @@
 
 bool nacc_fsm_is_waiting_addr_resolution(const struct nacc_fsm_ctx *ctx,
 					 const struct neigh_cache_entry_key *neigh_key);
+
+bool nacc_fsm_is_waiting_si_resolution(const struct nacc_fsm_ctx *ctx,
+				       const struct osmo_cell_global_id_ps *cgi_ps);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/25405
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I7378939825cc3ec3280f76bc51233c0a172d8a27
Gerrit-Change-Number: 25405
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210913/6e3e3543/attachment.htm>


More information about the gerrit-log mailing list