summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-04-10 16:47:17 +0200
committerMax <msuraev@sysmocom.de>2017-04-28 08:44:18 +0000
commita18001d50605b0c7d4ae54c812b8766f8e7f5f61 (patch)
tree25c546b30bc17038df09b73a4566f87eaf36bd52
parent8b8fca757eafc7ae07a8a3c9f522265c8c73f729 (diff)
Save PCU version reported by BTS
When BTS reports PCU disconnect - clear it. Change-Id: Idb32c73036413ee912f633604150ee17b611cfa7 Related: OS#1615
-rw-r--r--openbsc/src/libbsc/abis_nm.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 56b6fcf2a..132e72d9d 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -302,31 +302,27 @@ static inline void log_oml_fail_rep(const struct gsm_bts *bts, const char *type,
LOGPC(DNM, LOGL_ERROR, "\n");
}
-static inline void handle_manufact_report(const struct gsm_bts *bts,
- const uint8_t *p_val, const char *type,
+static inline void handle_manufact_report(struct gsm_bts *bts, const uint8_t *p_val, const char *type,
const char *severity, const char *text)
{
enum abis_mm_event_causes cause = osmo_load16be(p_val + 1);
switch (cause) {
case OSMO_EVT_PCU_VERS:
- if (text)
- LOGPC(DNM, LOGL_NOTICE,
- "BTS %u reported connected PCU version %s\n",
- bts->nr, text);
- else
- LOGPC(DNM, LOGL_ERROR,
- "BTS %u sent %s without actual version string.\n",
- bts->nr,
- get_value_string(abis_mm_event_cause_names,
- cause));
+ if (text) {
+ LOGPC(DNM, LOGL_NOTICE, "BTS %u reported connected PCU version %s\n", bts->nr, text);
+ osmo_strlcpy(bts->pcu_version, text, sizeof(bts->pcu_version));
+ } else {
+ LOGPC(DNM, LOGL_ERROR, "BTS %u reported PCU disconnection.\n", bts->nr);
+ bts->pcu_version[0] = '\0';
+ }
break;
default:
log_oml_fail_rep(bts, type, severity, p_val, text);
};
}
-static int rx_fail_evt_rep(struct msgb *mb, const struct gsm_bts *bts)
+static int rx_fail_evt_rep(struct msgb *mb, struct gsm_bts *bts)
{
struct abis_om_hdr *oh = msgb_l2(mb);
struct abis_om_fom_hdr *foh = msgb_l3(mb);