aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-11-29 13:21:58 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-10 14:18:41 +0000
commit115e2672fe168155d24e507cd52c87fcc724b117 (patch)
tree03ddd92d48b98285d76662ae19c68178e6d37d48 /src
parent9311005aff15f945d09458a9d7886c5b804797ea (diff)
OML: expand status reporting checks
* check GPRS state: if GPRS is enabled for the BTS but NSE, CELL or both NSVC are locked than report it as degraded * check TRX usability: use already available function to check that TRX is actually usable when reporting OML status via CTRL * fix tests linking: libbsc is using gsm48_create_mm_serv_rej() which is defined in libcommon-cs but neither libbsc itself nor tests using it are actually linked against libcommon-cs Related: OS#2486 Change-Id: I9dce1d3b0cabe149a90cfca58a3fe55f8d6a72bc
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/libbsc/Makefile.am2
-rw-r--r--src/libbsc/abis_nm.c17
3 files changed, 20 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index dd1ad3d38..454bf26e1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,10 +22,10 @@ AM_LDFLAGS = \
# Libraries
SUBDIRS = \
libcommon \
+ libcommon-cs \
libbsc \
libtrau \
libfilter \
- libcommon-cs \
$(NULL)
# Programs
diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index e78bde624..fc12d05d7 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -17,6 +17,8 @@ noinst_LIBRARIES = \
libbsc.a \
$(NULL)
+libbsc_a_LIBADD = $(top_builddir)/src/libcommon-cs/libcommon-cs.a
+
libbsc_a_SOURCES = \
abis_nm.c \
abis_nm_vty.c \
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index 2c84ba79f..33af2136a 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -46,6 +46,7 @@
#include <osmocom/bsc/misdn.h>
#include <osmocom/bsc/signal.h>
#include <osmocom/abis/e1_input.h>
+#include <osmocom/bsc/chan_alloc.h>
#define OM_ALLOC_SIZE 1024
#define OM_HEADROOM_SIZE 128
@@ -691,9 +692,25 @@ bool all_trx_rsl_connected_unlocked(const struct gsm_bts *bts)
if (bts->mo.nm_state.administrative == NM_STATE_LOCKED)
return false;
+ if (bts->gprs.mode != BTS_GPRS_NONE) {
+ if (bts->gprs.cell.mo.nm_state.administrative == NM_STATE_LOCKED)
+ return false;
+
+ if (bts->gprs.nse.mo.nm_state.administrative == NM_STATE_LOCKED)
+ return false;
+
+ if (bts->gprs.nsvc[0].mo.nm_state.administrative == NM_STATE_LOCKED &&
+ bts->gprs.nsvc[1].mo.nm_state.administrative == NM_STATE_LOCKED)
+ return false;
+ }
+
llist_for_each_entry(trx, &bts->trx_list, list) {
if (!trx->rsl_link)
return false;
+
+ if (!trx_is_usable(trx))
+ return false;
+
if (trx->mo.nm_state.administrative == NM_STATE_LOCKED)
return false;
}