diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-12-11 03:12:39 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-01-05 23:27:26 +0100 |
commit | 58eceb06b53788f8e08184674010fb71c742c5d7 (patch) | |
tree | 679082bee9ded1ccb3167df497d2099bb4e0f70d /tests | |
parent | 05da6c1f364edc4c6fb28217ffad9f046649ba9f (diff) |
handover_test.c: properly release lchans in set-ts-use
An upcoming test that uses set-ts-use to release used lchans uncovered
an incomplete release, keeping the lchans occupied due to a missing
release ack. Always ack the release.
Change-Id: Ia22906bfbfcc48b7bd08473a2b17f6b0554687d3
Diffstat (limited to 'tests')
-rw-r--r-- | tests/handover/handover_test.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index cbe0cf37e..c0c5bb944 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -435,9 +435,20 @@ struct gsm_lchan *create_lchan(struct gsm_bts *bts, int full_rate, const char *c return lchan_act(lchan, full_rate, codec); } +static void lchan_release_ack(struct gsm_lchan *lchan) +{ + if (lchan->fi && lchan->fi->state == LCHAN_ST_WAIT_BEFORE_RF_RELEASE) { + /* don't wait before release */ + osmo_fsm_inst_state_chg(lchan->fi, LCHAN_ST_WAIT_RF_RELEASE_ACK, 0, 0); + /* ack the release */ + osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RSL_RF_CHAN_REL_ACK, 0); + } +} + static void lchan_clear(struct gsm_lchan *lchan) { lchan_release(lchan, true, false, 0); + lchan_release_ack(lchan); } static void ts_clear(struct gsm_bts_trx_ts *ts) @@ -674,16 +685,6 @@ static void send_ho_complete(struct gsm_lchan *lchan, bool success) abis_rsl_rcvmsg(msg); } -static void lchan_release_ack(struct gsm_lchan *lchan) -{ - if (lchan->fi && lchan->fi->state == LCHAN_ST_WAIT_BEFORE_RF_RELEASE) { - /* don't wait before release */ - osmo_fsm_inst_state_chg(lchan->fi, LCHAN_ST_WAIT_RF_RELEASE_ACK, 0, 0); - /* ack the release */ - osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RSL_RF_CHAN_REL_ACK, 0); - } -} - /* override, requires '-Wl,--wrap=abis_rsl_sendmsg'. * Catch RSL messages sent towards the BTS. */ int __real_abis_rsl_sendmsg(struct msgb *msg); |