From 64c422858db9388e210875dc681f2d1952e0d0bb Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 1 Dec 2020 17:25:28 +0100 Subject: 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 --- include/osmocom/bsc/bts_sm.h | 72 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 include/osmocom/bsc/bts_sm.h (limited to 'include/osmocom/bsc/bts_sm.h') diff --git a/include/osmocom/bsc/bts_sm.h b/include/osmocom/bsc/bts_sm.h new file mode 100644 index 000000000..37ace7731 --- /dev/null +++ b/include/osmocom/bsc/bts_sm.h @@ -0,0 +1,72 @@ +/* BTS Site Manager */ + +/* (C) 2020 by sysmocom - s.m.f.c. GmbH + * Author: Pau Espin Pedrol + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +#include "osmocom/bsc/gsm_data.h" + +struct gsm_bts; + +struct gsm_gprs_nse { + struct gsm_abis_mo mo; + uint16_t nsei; + uint8_t timer[7]; +}; + +struct gsm_gprs_nsvc { + struct gsm_bts *bts; + /* data read via VTY config file, to configure the BTS + * via OML from BSC */ + int id; + uint16_t nsvci; + uint16_t local_port; /* on the BTS */ + struct osmo_sockaddr remote; + struct gsm_abis_mo mo; +}; + + +/* BTS Site Manager */ +struct gsm_bts_sm { + struct gsm_bts *bts[1]; /* only one bts supported so far */ + struct gsm_abis_mo mo; + /* nanoBTS and old versions of osmo-bts behaves this way due to + broken FSMs not following TS 12.21: they never do + Dependency->Offline transition, but they should be OPSTARTed + nevertheless during Dependnecy state to work. This field is + used by all dependent NM objects. */ + bool peer_has_no_avstate_offline; + struct { + struct gsm_gprs_nse nse; + struct gsm_gprs_nsvc nsvc[2]; + } gprs; +}; + +static inline struct gsm_bts *gsm_bts_sm_get_bts(struct gsm_bts_sm *site_mgr) { + return site_mgr->bts[0]; +} + +struct gsm_bts_sm *gsm_bts_sm_alloc(struct gsm_network *net, uint8_t bts_num); + +void gsm_bts_sm_mo_reset(struct gsm_bts_sm *bts_sm); -- cgit v1.2.3