aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/libbsc/abis_rsl.c22
-rw-r--r--openbsc/src/libbsc/bsc_vty.c7
-rw-r--r--openbsc/src/libbsc/chan_alloc.c2
3 files changed, 22 insertions, 9 deletions
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index d9fe92c96..eb914b1f4 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -207,7 +207,7 @@ static void lchan_act_tmr_cb(void *data)
"%s Timeout during activation. Marked as broken.\n",
gsm_lchan_name(lchan));
- rsl_lchan_set_state(lchan, LCHAN_S_BROKEN);
+ rsl_lchan_mark_broken(lchan, "activation timeout");
lchan_free(lchan);
}
@@ -219,7 +219,7 @@ static void lchan_deact_tmr_cb(void *data)
"%s Timeout during deactivation! Marked as broken.\n",
gsm_lchan_name(lchan));
- rsl_lchan_set_state(lchan, LCHAN_S_BROKEN);
+ rsl_lchan_mark_broken(lchan, "de-activation timeout");
lchan_free(lchan);
}
@@ -940,6 +940,13 @@ int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id,
return 0;
}
+int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *reason)
+{
+ lchan->state = LCHAN_S_BROKEN;
+ lchan->broken_reason = reason;
+ return 0;
+}
+
int rsl_lchan_set_state(struct gsm_lchan *lchan, int state)
{
lchan->state = state;
@@ -1010,13 +1017,14 @@ static int rsl_rx_chan_act_nack(struct msgb *msg)
print_rsl_cause(LOGL_ERROR, cause,
TLVP_LEN(&tp, RSL_IE_CAUSE));
msg->lchan->error_cause = *cause;
- if (*cause != RSL_ERR_RCH_ALR_ACTV_ALLOC)
- rsl_lchan_set_state(msg->lchan, LCHAN_S_BROKEN);
- else
+ if (*cause != RSL_ERR_RCH_ALR_ACTV_ALLOC) {
+ rsl_lchan_mark_broken(msg->lchan, "NACK on activation");
+ } else
rsl_rf_chan_release(msg->lchan, 1, SACCH_DEACTIVATE);
- } else
- rsl_lchan_set_state(msg->lchan, LCHAN_S_BROKEN);
+ } else {
+ rsl_lchan_mark_broken(msg->lchan, "NACK on activation no IE");
+ }
LOGPC(DRSL, LOGL_ERROR, "\n");
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index d6d66c638..cc2eefeb1 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -959,9 +959,12 @@ static void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan)
vty_out(vty, "BTS %u, TRX %u, Timeslot %u, Lchan %u: Type %s%s",
lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr,
lchan->nr, gsm_lchant_name(lchan->type), VTY_NEWLINE);
- vty_out(vty, " Connection: %u, State: %s%s",
+ vty_out(vty, " Connection: %u, State: %s%s%s%s",
lchan->conn ? 1: 0,
- gsm_lchans_name(lchan->state), VTY_NEWLINE);
+ gsm_lchans_name(lchan->state),
+ lchan->state == LCHAN_S_BROKEN ? "Error reason " : "",
+ lchan->state == LCHAN_S_BROKEN ? lchan->broken_reason : "",
+ VTY_NEWLINE);
vty_out(vty, " BS Power: %u dBm, MS Power: %u dBm%s",
lchan->ts->trx->nominal_power - lchan->ts->trx->max_power_red
- lchan->bs_power*2,
diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c
index cd96c1b38..64833dd8a 100644
--- a/openbsc/src/libbsc/chan_alloc.c
+++ b/openbsc/src/libbsc/chan_alloc.c
@@ -286,6 +286,8 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type,
/* clear multi rate config */
memset(&lchan->mr_conf, 0, sizeof(lchan->mr_conf));
+
+ lchan->broken_reason = "";
} else {
struct challoc_signal_data sig;
sig.bts = bts;