diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-09-22 18:40:25 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-09-23 14:07:53 +0200 |
commit | 2e90e0f756a6bdcb6679acd4ca678803be90ce09 (patch) | |
tree | 5119b27d3fc85e5f44f4a94357f18b11f18aa6d0 | |
parent | 130e2e59c65aba55a2402ad8c09afc00a7c1c14a (diff) |
Avoid sending Load Indications when BTS is not RSL-connected
Change-Id: I97e8dd7dd58ee2ec90c3a38d45dfd944db44c412
-rw-r--r-- | include/osmo-bts/bts.h | 2 | ||||
-rw-r--r-- | src/common/abis.c | 2 | ||||
-rw-r--r-- | src/common/bts.c | 1 | ||||
-rw-r--r-- | src/common/bts_trx.c | 3 | ||||
-rw-r--r-- | src/common/load_indication.c | 5 | ||||
-rw-r--r-- | src/common/oml.c | 5 |
6 files changed, 16 insertions, 2 deletions
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index a6014239..fab7f96d 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -409,6 +409,8 @@ uint8_t *lchan_sacch_get(struct gsm_lchan *lchan); int lchan_init_lapdm(struct gsm_lchan *lchan); void load_timer_start(struct gsm_bts *bts); +void load_timer_stop(struct gsm_bts *bts); +bool load_timer_is_running(const struct gsm_bts *bts); void bts_update_status(enum bts_global_status which, int on); struct gsm_time *get_time(struct gsm_bts *bts); diff --git a/src/common/abis.c b/src/common/abis.c index 1b489c17..3451b2ec 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -213,6 +213,8 @@ static void abis_link_connected(struct osmo_fsm_inst *fi, uint32_t event, void * if (trx->rsl_link) { e1inp_sign_link_destroy(trx->rsl_link); trx->rsl_link = NULL; + if (trx == trx->bts->c0) + load_timer_stop(trx->bts); } /* Note: Here we could send NM_EV_RSL_DOWN to each * trx->(bb_transc.)mo.fi, but we are starting shutdown of the diff --git a/src/common/bts.c b/src/common/bts.c index 67e67367..191c331c 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -345,7 +345,6 @@ int bts_init(struct gsm_bts *bts) /* configurable via OML */ bts->load.ccch.load_ind_period = 112; - load_timer_start(bts); bts->rtp_jitter_buf_ms = 100; bts->max_ta = 63; bts->ny1 = 4; diff --git a/src/common/bts_trx.c b/src/common/bts_trx.c index ed742d57..127e7977 100644 --- a/src/common/bts_trx.c +++ b/src/common/bts_trx.c @@ -217,6 +217,9 @@ int trx_link_estab(struct gsm_bts_trx *trx) oml_tx_failure_event_rep(&trx->bb_transc.mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_RSL_FAIL, "Failed to establish RSL link (%d)", rc); + if (trx == trx->bts->c0) + load_timer_start(trx->bts); + return 0; } diff --git a/src/common/load_indication.c b/src/common/load_indication.c index c9b26458..69af9c69 100644 --- a/src/common/load_indication.c +++ b/src/common/load_indication.c @@ -94,3 +94,8 @@ void load_timer_stop(struct gsm_bts *bts) { osmo_timer_del(&bts->load.ccch.timer); } + +bool load_timer_is_running(const struct gsm_bts *bts) +{ + return osmo_timer_pending(&bts->load.ccch.timer); +} diff --git a/src/common/oml.c b/src/common/oml.c index d2cf8770..f841853f 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -670,7 +670,10 @@ static int oml_rx_set_bts_attr(struct gsm_bts *bts, struct msgb *msg) /* 9.4.11 CCCH Load Indication Period */ if (TLVP_PRES_LEN(&tp, NM_ATT_CCCH_L_I_P, 1)) { bts->load.ccch.load_ind_period = *TLVP_VAL(&tp, NM_ATT_CCCH_L_I_P); - load_timer_start(bts); + if (load_timer_is_running(bts)) { + load_timer_stop(bts); + load_timer_start(bts); + } } /* 9.4.44 RACH Busy Threshold */ |