diff options
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r-- | src/osmo-bsc/chan_alloc.c | 7 | ||||
-rw-r--r-- | src/osmo-bsc/gsm_data.c | 4 | ||||
-rw-r--r-- | src/osmo-bsc/paging.c | 10 | ||||
-rw-r--r-- | src/osmo-bsc/timeslot_fsm.c | 23 |
4 files changed, 29 insertions, 15 deletions
diff --git a/src/osmo-bsc/chan_alloc.c b/src/osmo-bsc/chan_alloc.c index f23a982a1..226984d56 100644 --- a/src/osmo-bsc/chan_alloc.c +++ b/src/osmo-bsc/chan_alloc.c @@ -45,7 +45,7 @@ void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts) llist_for_each_entry(trx, &bts->trx_list, list) { int i; - /* skip administratively deactivated tranxsceivers */ + /* skip administratively deactivated transceivers */ if (!trx_is_usable(trx)) continue; @@ -58,6 +58,11 @@ void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts) if (!nm_is_running(&ts->mo.nm_state)) continue; + /* skip timeslots which are not yet initialized or which + * have been de-initialized due to RSL link going down */ + if (ts->fi->state == TS_ST_NOT_INITIALIZED) + continue; + /* Dynamic timeslots have to be counted separately * when not in TCH/F or TCH/H mode because they don't * have an lchan's allocated to them. At the same time, diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 46e26acff..0df45bf5c 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -1373,6 +1373,10 @@ bool ts_is_tch(struct gsm_bts_trx_ts *ts) bool trx_is_usable(const struct gsm_bts_trx *trx) { + /* not usable when RSL link is down */ + if (trx->rsl_link == NULL) + return false; + /* FIXME: How does this behave for BS-11 ? */ if (is_ipaccess_bts(trx->bts)) { if (!nm_is_running(&trx->mo.nm_state) || diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 7b89dad9b..22e572a6b 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -59,12 +59,6 @@ void *tall_paging_ctx = NULL; #define PAGING_TIMER 0, 500000 /* - * TODO MSCSPLIT: the paging in libbsc is closely tied to MSC land in that the - * MSC realm callback functions used to be invoked from the BSC/BTS level. So - * this entire file needs to be rewired for use with an A interface. - */ - -/* * Kill one paging request update the internal list... */ static void paging_remove_request(struct gsm_bts_paging_state *paging_bts, @@ -441,7 +435,9 @@ void paging_request_stop(struct llist_head *bts_list, /* Sort of an optimization. */ if (bts == _bts) continue; - _paging_request_stop(bts, bsub, NULL, NULL); + if (_paging_request_stop(bts, bsub, NULL, NULL) == 0) { + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_PAGING_RESPONDED_ELSEWHERE]); + } } log_set_context(LOG_CTX_BSC_SUBSCR, NULL); } diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 4816dafb5..541cfd97e 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -750,14 +750,25 @@ static int ts_fsm_timer_cb(struct osmo_fsm_inst *fi) } } +static void _count_borken_on_teardown(struct osmo_fsm_inst *fi) +{ + struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); + if (ts->fi->state == TS_ST_BORKEN) { + rate_ctr_inc(&ts->trx->bts->bts_ctrs->ctr[BTS_CTR_TS_BORKEN_EV_TEARDOWN]); + osmo_stat_item_dec(ts->trx->bts->bts_statg->items[BTS_STAT_TS_BORKEN], 1); + } +} + static void ts_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); switch (event) { case TS_EV_OML_DOWN: ts->is_oml_ready = false; - if (fi->state != TS_ST_NOT_INITIALIZED) + if (fi->state != TS_ST_NOT_INITIALIZED) { + _count_borken_on_teardown(fi); osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0); + } OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED); ts_terminate_lchan_fsms(ts); ts->pchan_is = ts->pchan_on_init = GSM_PCHAN_NONE; @@ -766,8 +777,10 @@ static void ts_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data case TS_EV_RSL_DOWN: ts->is_rsl_ready = false; - if (fi->state != TS_ST_NOT_INITIALIZED) + if (fi->state != TS_ST_NOT_INITIALIZED) { + _count_borken_on_teardown(fi); osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0); + } OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED); ts->pchan_is = GSM_PCHAN_NONE; ts_lchans_dispatch(ts, -1, LCHAN_EV_TS_ERROR); @@ -780,11 +793,7 @@ static void ts_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data static void ts_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) { - struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); - if (ts->fi->state == TS_ST_BORKEN) { - rate_ctr_inc(&ts->trx->bts->bts_ctrs->ctr[BTS_CTR_TS_BORKEN_EV_TEARDOWN]); - osmo_stat_item_dec(ts->trx->bts->bts_statg->items[BTS_STAT_TS_BORKEN], 1); - } + _count_borken_on_teardown(fi); } #define S(x) (1 << (x)) |