diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2021-11-07 21:03:26 +0300 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2021-11-07 21:28:18 +0300 |
commit | 70ab41e9cdae79d84669451edeb4cb4f3c1d6e11 (patch) | |
tree | 50f03c49f023f53a77110abf0737b8c3d51fa2b0 | |
parent | d5a6dca2f946f292fabf47b7e9e5e5914424c3d5 (diff) |
abis_rsl: do not pass lchan to print_meas_rep_buf()
Change-Id: If965c7dc6b989ee758ddec0190ec1cce8363b240
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index cdd57c257..f849d271a 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -1177,21 +1177,11 @@ static void print_meas_rep_uni(struct osmo_strbuf *sb, struct gsm_meas_rep_unidi prefix, mru->full.rx_qual, prefix, mru->sub.rx_qual); } -static int print_meas_rep_buf(char *buf, size_t len, struct gsm_lchan *lchan, struct gsm_meas_rep *mr) +static int print_meas_rep_buf(char *buf, size_t len, struct gsm_meas_rep *mr) { - const char *name = ""; - struct bsc_subscr *bsub = NULL; struct osmo_strbuf sb = { .buf = buf, .len = len }; - if (lchan && lchan->conn) { - bsub = lchan->conn->bsub; - if (bsub) { - name = bsc_subscr_name(bsub); - } else - name = lchan->name; - } - - OSMO_STRBUF_PRINTF(sb, "[%s] MEASUREMENT RESULT NR=%d ", name, mr->nr); + OSMO_STRBUF_PRINTF(sb, "MEASUREMENT RESULT NR=%d ", mr->nr); if (mr->flags & MEAS_REP_F_DL_DTX) OSMO_STRBUF_PRINTF(sb, "DTXd "); @@ -1222,25 +1212,30 @@ static int print_meas_rep_buf(char *buf, size_t len, struct gsm_lchan *lchan, st return sb.chars_needed; } -static char *print_meas_rep_c(void *ctx, struct gsm_lchan *lchan, struct gsm_meas_rep *mr) +static char *print_meas_rep_c(void *ctx, struct gsm_meas_rep *mr) { /* A naive count of required characters gets me to ~200, so 256 should be safe to get a large enough buffer on * the first time. */ - OSMO_NAME_C_IMPL(ctx, 256, "ERROR", print_meas_rep_buf, lchan, mr) + OSMO_NAME_C_IMPL(ctx, 256, "ERROR", print_meas_rep_buf, mr) } static void print_meas_rep(struct gsm_lchan *lchan, struct gsm_meas_rep *mr) { int i; + const char *name = ""; struct bsc_subscr *bsub = NULL; if (lchan && lchan->conn) { bsub = lchan->conn->bsub; - if (bsub) + if (bsub) { log_set_context(LOG_CTX_BSC_SUBSCR, bsub); + name = bsc_subscr_name(bsub); + } else { + name = lchan->name; + } } - DEBUGP(DMEAS, "%s\n", print_meas_rep_c(OTC_SELECT, lchan, mr)); + DEBUGP(DMEAS, "[%s] %s\n", name, print_meas_rep_c(OTC_SELECT, mr)); if (mr->num_cell != 7 && log_check_level(DMEAS, LOGL_DEBUG)) { |