aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/handover_decision_2.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-27 23:17:14 +0000
committerNeels Hofmeyr <neels@hofmeyr.de>2021-05-27 17:06:21 +0200
commit0951d756655d7c637efd450d125f7a9ae38098eb (patch)
tree9fbb7624307603e47d0856c8a0594a2981ac5dff /src/osmo-bsc/handover_decision_2.c
parentd587574d7b9613f2cc733aa4a82d5a9c6f068193 (diff)
make sure channel mode and s15_s0 are updated only after an ACK
I noticed during testing that an lchan used as TCH/F in fact still had its channel mode set to Signalling -- because on Assignment, the Speech mode used to be placed in the *previous* lchan and the new lchan was never updated after the Activ ACK. This is unbearable confusion which I complained about numerous times, so far mostly for cosmetic reasons. But implementing re-assignment properly actually requires this to be cleaned up. Keep all volatile chan mode settings in lchan->activate.* or lchan->modify.*, and only update lchan->* members when an ACK has been received for those settings. So a failed request keeps a sane state. Make sure that those settings are in fact updated in the proper lchan, upon an ACK, so that subsequent re-assignment or mode-modify know the accurate lchan state. Related are upcoming patches that sort out the AMR multirate configuration in a similar fashion, see Iebac2dc26412d877e5364f90d6f2ed7a7952351e Ia7519d2fa9e7f0b61b222d27d077bde4660c40b9 Ie57f9d0e3912632903d9740291225bfd1634ed47. Related: SYS#5315 OS#4940 OS#3787 OS#3833 Change-Id: Ie0da36124d73efc28a8809b63d7c96e2167fc412
Diffstat (limited to 'src/osmo-bsc/handover_decision_2.c')
-rw-r--r--src/osmo-bsc/handover_decision_2.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index 3326c0bb6..5b7d4b16c 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -52,7 +52,7 @@
lchan->ts->nr, \
lchan->nr, \
gsm_lchant_name(lchan->type), \
- gsm48_chan_mode_name(lchan->tch_mode), \
+ gsm48_chan_mode_name(lchan->current_ch_mode_rate.chan_mode), \
bsc_subscr_name(lchan->conn? lchan->conn->bsub : NULL), \
## args)
@@ -63,7 +63,7 @@
lchan->ts->nr, \
lchan->nr, \
gsm_lchant_name(lchan->type), \
- gsm48_chan_mode_name(lchan->tch_mode), \
+ gsm48_chan_mode_name(lchan->current_ch_mode_rate.chan_mode), \
new_bts->nr, \
bsc_subscr_name(lchan->conn? lchan->conn->bsub : NULL), \
## args)
@@ -75,7 +75,7 @@
lchan->ts->nr, \
lchan->nr, \
gsm_lchant_name(lchan->type), \
- gsm48_chan_mode_name(lchan->tch_mode), \
+ gsm48_chan_mode_name(lchan->current_ch_mode_rate.chan_mode), \
gsm0808_cell_id_list_name(remote_cil), \
bsc_subscr_name(lchan->conn? lchan->conn->bsub : NULL), \
## args)
@@ -478,7 +478,7 @@ static void check_requirements(struct ho_candidate *c)
/* compatibility check for codecs.
* if so, the candidates for full rate and half rate are selected */
- switch (c->current.lchan->tch_mode) {
+ switch (c->current.lchan->current_ch_mode_rate.chan_mode) {
case GSM48_CMODE_SPEECH_V1:
switch (c->current.lchan->type) {
case GSM_LCHAN_TCH_F: /* mandatory */
@@ -489,7 +489,7 @@ static void check_requirements(struct ho_candidate *c)
LOGPHOLCHANTOBTS(c->current.lchan, c->target.bts, LOGL_DEBUG,
"tch_mode='%s' type='%s' not supported\n",
get_value_string(gsm48_chan_mode_names,
- c->current.lchan->tch_mode),
+ c->current.lchan->current_ch_mode_rate.chan_mode),
gsm_lchant_name(c->current.lchan->type));
break;
}
@@ -498,7 +498,8 @@ static void check_requirements(struct ho_candidate *c)
break;
default:
LOGPHOLCHAN(c->current.lchan, LOGL_ERROR, "Unexpected channel type: neither TCH/F nor TCH/H for %s\n",
- get_value_string(gsm48_chan_mode_names, c->current.lchan->tch_mode));
+ get_value_string(gsm48_chan_mode_names,
+ c->current.lchan->current_ch_mode_rate.chan_mode));
return;
}
break;
@@ -757,7 +758,7 @@ static void check_requirements_remote_bss(struct ho_candidate *c)
/* compatibility check for codecs -- we have no notion of what the remote BSS supports. We can
* only assume that a handover would work, and use only the local requirements. */
- switch (c->current.lchan->tch_mode) {
+ switch (c->current.lchan->current_ch_mode_rate.chan_mode) {
case GSM48_CMODE_SPEECH_V1:
switch (c->current.lchan->type) {
case GSM_LCHAN_TCH_F: /* mandatory */
@@ -769,7 +770,8 @@ static void check_requirements_remote_bss(struct ho_candidate *c)
break;
default:
LOGPHOLCHAN(c->current.lchan, LOGL_ERROR, "Unexpected channel type: neither TCH/F nor TCH/H for %s\n",
- get_value_string(gsm48_chan_mode_names, c->current.lchan->tch_mode));
+ get_value_string(gsm48_chan_mode_names,
+ c->current.lchan->current_ch_mode_rate.chan_mode));
return;
}
break;
@@ -815,7 +817,7 @@ static int trigger_local_ho_or_as(struct ho_candidate *c, uint8_t requirements)
bool full_rate = false;
/* afs_bias becomes > 0, if AFS is used and is improved */
- if (c->current.lchan->tch_mode == GSM48_CMODE_SPEECH_AMR)
+ if (c->current.lchan->current_ch_mode_rate.chan_mode == GSM48_CMODE_SPEECH_AMR)
afs_bias = ho_get_hodec2_afs_bias_rxlev(c->target.bts->ho);
/* select TCH rate, prefer TCH/F if AFS is improved */
@@ -1243,7 +1245,7 @@ static void collect_candidates_for_lchan(struct gsm_lchan *lchan,
static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_rxlev)
{
struct gsm_bts *bts = lchan->ts->trx->bts;
- int ahs = (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR
+ int ahs = (lchan->current_ch_mode_rate.chan_mode == GSM48_CMODE_SPEECH_AMR
&& lchan->type == GSM_LCHAN_TCH_H);
int rxlev_current;
struct ho_candidate clist[1 + ARRAY_SIZE(lchan->neigh_meas)];
@@ -1451,7 +1453,7 @@ static void on_measurement_report(struct gsm_meas_rep *mr)
/* improve levels in case of AFS, if defined */
if (lchan->type == GSM_LCHAN_TCH_F
- && lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) {
+ && lchan->current_ch_mode_rate.chan_mode == GSM48_CMODE_SPEECH_AMR) {
int av_rxlev_was = av_rxlev;
int av_rxqual_was = av_rxqual;
int rxlev_bias = ho_get_hodec2_afs_bias_rxlev(bts->ho);