Change in osmo-bts[master]: Reset CBCH state after BTS shutdown

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
Wed Oct 20 14:16:23 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/25841 )


Change subject: Reset CBCH state after BTS shutdown
......................................................................

Reset CBCH state after BTS shutdown

Related: OS#5273
Change-Id: Ib01d38c59ba9fa083fcc0682009c13d2db3664fe
---
M include/osmo-bts/cbch.h
M src/common/cbch.c
M src/common/nm_bts_fsm.c
3 files changed, 23 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/25841/1

diff --git a/include/osmo-bts/cbch.h b/include/osmo-bts/cbch.h
index 6bba5fa..d5521f0 100644
--- a/include/osmo-bts/cbch.h
+++ b/include/osmo-bts/cbch.h
@@ -21,3 +21,5 @@
 /* call-back from bts model specific code when it wants to obtain a CBCH
  * block for a given gsm_time.  outbuf must have 23 bytes of space. */
 int bts_cbch_get(struct gsm_bts *bts, uint8_t *outbuf, struct gsm_time *g_time);
+
+void bts_cbch_reset(struct gsm_bts *bts);
diff --git a/src/common/cbch.c b/src/common/cbch.c
index ebea60b..addd68c 100644
--- a/src/common/cbch.c
+++ b/src/common/cbch.c
@@ -322,3 +322,22 @@
 
 	return rc;
 }
+
+static void bts_smscb_state_reset(struct bts_smscb_state *bts_ss)
+{
+	struct smscb_msg *scm, *tmp;
+	llist_for_each_entry_safe(scm, tmp, &bts_ss->queue, list) {
+		llist_del(&scm->list);
+		talloc_free(scm);
+	}
+	bts_ss->queue_len = 0;
+	rate_ctr_group_reset(bts_ss->ctrs);
+	TALLOC_FREE(bts_ss->cur_msg);
+	TALLOC_FREE(bts_ss->default_msg);
+}
+
+void bts_cbch_reset(struct gsm_bts *bts)
+{
+	bts_smscb_state_reset(&bts->smscb_basic);
+	bts_smscb_state_reset(&bts->smscb_extended);
+}
diff --git a/src/common/nm_bts_fsm.c b/src/common/nm_bts_fsm.c
index c9dcd4c..063ffe8 100644
--- a/src/common/nm_bts_fsm.c
+++ b/src/common/nm_bts_fsm.c
@@ -35,6 +35,7 @@
 #include <osmo-bts/rsl.h>
 #include <osmo-bts/nm_common_fsm.h>
 #include <osmo-bts/phy_link.h>
+#include <osmo-bts/cbch.h>
 
 #define X(s) (1 << (s))
 
@@ -60,6 +61,7 @@
 	/* Reset state: */
 	bts->si_valid = 0;
 	TALLOC_FREE(bts->mo.nm_attr);
+	bts_cbch_reset(bts);
 
 	bts->mo.setattr_success = false;
 	bts->mo.opstart_success = false;

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib01d38c59ba9fa083fcc0682009c13d2db3664fe
Gerrit-Change-Number: 25841
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211020/3531e2eb/attachment.htm>


More information about the gerrit-log mailing list