aboutsummaryrefslogtreecommitdiffstats
path: root/tests/acc
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-12-01 17:25:28 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-12-03 16:31:36 +0100
commit64c422858db9388e210875dc681f2d1952e0d0bb (patch)
tree85d8baa6526562e89c9912d3da76507e0ce4fba3 /tests/acc
parent8c03bf3f3c58afa582ed000ba05e886b593256f9 (diff)
Store GPRS MOs directly under BTS SiteMgr object
The only real 1-1 relationship between BTS NM objects is the one between GPRS Cell and BTS (which is actually a BTS cell). In our current osmo-bts implementation we don't care much since we only handle 1-cell BTSses, but let's make the data structure organization more generic. Implementation notes: The gsm_bts_sm is moved to its own file, APIs to allocate are added and the new public object is hooked correctly in the allocation process of osmo-bsc. Change-Id: I06461b7784fa2a78de37383406e35beae85fbad8
Diffstat (limited to 'tests/acc')
-rw-r--r--tests/acc/Makefile.am1
-rw-r--r--tests/acc/acc_test.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/acc/Makefile.am b/tests/acc/Makefile.am
index b1315e383..1536365eb 100644
--- a/tests/acc/Makefile.am
+++ b/tests/acc/Makefile.am
@@ -28,6 +28,7 @@ acc_test_LDADD = \
$(top_builddir)/src/osmo-bsc/abis_nm.o \
$(top_builddir)/src/osmo-bsc/acc.o \
$(top_builddir)/src/osmo-bsc/bts.o \
+ $(top_builddir)/src/osmo-bsc/bts_sm.o \
$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \
$(top_builddir)/src/osmo-bsc/bts_trx.o \
$(top_builddir)/src/osmo-bsc/gsm_data.o \
diff --git a/tests/acc/acc_test.c b/tests/acc/acc_test.c
index 81b9e8dd2..73757c7c6 100644
--- a/tests/acc/acc_test.c
+++ b/tests/acc/acc_test.c
@@ -44,7 +44,8 @@ static void clock_debug(char* str)
#define bts_init(net) _bts_init(net, __func__)
static inline struct gsm_bts *_bts_init(struct gsm_network *net, const char *msg)
{
- struct gsm_bts *bts = gsm_bts_alloc(net, 0);
+ struct gsm_bts_sm *bts_sm = gsm_bts_sm_alloc(net, 0);
+ struct gsm_bts *bts = bts_sm->bts[0];
if (!bts) {
fprintf(stderr, "BTS allocation failure in %s()\n", msg);
exit(1);
@@ -66,7 +67,7 @@ static inline void _bts_del(struct gsm_bts *bts, const char *msg)
if (osmo_timer_pending(&bts->acc_ramp.step_timer))
osmo_timer_del(&bts->acc_ramp.step_timer);
/* no need to llist_del(&bts->list), we never registered the bts there. */
- talloc_free(bts);
+ talloc_free(bts->site_mgr);
fprintf(stderr, "BTS deallocated OK in %s()\n", msg);
}