aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-12-06 19:25:06 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-12-23 20:18:18 +0100
commit638da51a786c279cf7769afbb6fdb56cc4c6c867 (patch)
tree19e0232c06514cbf8382c6cb7a525b31921ef970 /openbsc
parent9d50a27695fe512df2b429ecae93e66941a3f7e9 (diff)
lchan: Introduce a BROKEN state for the lchan
If the CHAN ACTIV is NACKED we set the state backto NONE. This is problematic as our channel allocator will allocate from the front or from the back and if the channel is early in the list it might cause permanent failures. Introduce a BROKEN state and use it when the channel activation is failing for an unknown reason. Copy the cause so it can be inspected later.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h2
-rw-r--r--openbsc/src/libbsc/abis_rsl.c7
-rw-r--r--openbsc/src/libcommon/gsm_data_shared.c1
3 files changed, 6 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 27bbe5c9b..21fa6456a 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -120,6 +120,7 @@ enum gsm_lchan_state {
LCHAN_S_ACTIVE, /* channel is active and operational */
LCHAN_S_REL_REQ, /* channel release has been requested */
LCHAN_S_REL_ERR, /* channel is in an error state */
+ LCHAN_S_BROKEN, /* channel is somehow unusable */
LCHAN_S_INACTIVE, /* channel is set inactive */
};
@@ -219,6 +220,7 @@ struct gsm_lchan {
struct osmo_timer_list T3111;
struct osmo_timer_list error_timer;
struct osmo_timer_list act_timer;
+ uint8_t error_cause;
/* table of neighbor cell measurements */
struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 09f24f606..04d5c61b3 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -935,19 +935,18 @@ static int rsl_rx_chan_act_nack(struct msgb *msg)
const uint8_t *cause = TLVP_VAL(&tp, RSL_IE_CAUSE);
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_NONE);
+ rsl_lchan_set_state(msg->lchan, LCHAN_S_BROKEN);
else
rsl_rf_chan_release(msg->lchan, 1);
} else
- rsl_lchan_set_state(msg->lchan, LCHAN_S_NONE);
+ rsl_lchan_set_state(msg->lchan, LCHAN_S_BROKEN);
LOGPC(DRSL, LOGL_ERROR, "\n");
send_lchan_signal(S_LCHAN_ACTIVATE_NACK, msg->lchan, NULL);
-
- lchan_free(msg->lchan);
return 0;
}
diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c
index eaf53b770..ef29d6a17 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -109,6 +109,7 @@ static const struct value_string lchan_s_names[] = {
{ LCHAN_S_INACTIVE, "INACTIVE" },
{ LCHAN_S_REL_REQ, "RELEASE REQUESTED" },
{ LCHAN_S_REL_ERR, "RELEASE DUE ERROR" },
+ { LCHAN_S_BROKEN, "BROKEN UNUSABLE" },
{ 0, NULL }
};