From ac3fd120268a38fb4794982823c6abc8e964cfe8 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 13 Jan 2021 18:54:38 +0100 Subject: Split PCU global PCU object from BTS object Currently the BTS object (and gprs_rlcmac_bts struct) are used to hold both PCU global fields and BTS specific fields, all mangled together. The BTS is even accessed in lots of places by means of a singleton. This patch introduces a new struct gprs_pcu object aimed at holding all global state, and several fields are already moved from BTS to it. The new object can be accessed as global variable "the_pcu", reusing and including an already exisitng "the_pcu" global variable only used for bssgp related purposes so far. This is only a first step towards having a complete split global pcu and BTS, some fields are still kept in BTS and will be moved over follow-up smaller patches in the future (since this patch is already quite big). So far, the code still only supports one BTS, which can be accessed using the_pcu->bts. In the future that field will be replaced with a list, and the BTS singletons will be removed. The cur_fn output changes in TbfTest are actually a side effect fix, since the singleton main_bts() now points internally to the_pcu->bts, hence the same we allocate and assign in the test. Beforehand, "the_bts" was allocated in the stack while main_bts() still returned an unrelated singleton BTS object instance. Related: OS#4935 Change-Id: I88e3c6471b80245ce3798223f1a61190f14aa840 --- src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 386a1f64..c9c7aa3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,6 +49,7 @@ libgprs_la_SOURCES = \ gprs_rlcmac_ts_alloc.cpp \ gprs_ms.c \ gprs_ms_storage.cpp \ + gprs_pcu.c \ gsm_timer.cpp \ pcu_l1_if.cpp \ pcu_vty.c \ @@ -84,6 +85,7 @@ noinst_HEADERS = \ gprs_rlcmac.h \ gprs_ms.h \ gprs_ms_storage.h \ + gprs_pcu.h \ pcu_l1_if.h \ gsm_timer.h \ pcu_vty.h \ -- cgit v1.2.3