diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-04-27 23:17:14 +0000 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-05-27 17:06:21 +0200 |
commit | 0951d756655d7c637efd450d125f7a9ae38098eb (patch) | |
tree | 9fbb7624307603e47d0856c8a0594a2981ac5dff /src/osmo-bsc/bsc_vty.c | |
parent | d587574d7b9613f2cc733aa4a82d5a9c6f068193 (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/bsc_vty.c')
-rw-r--r-- | src/osmo-bsc/bsc_vty.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index b964dbc9e..7ede51a05 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -1624,7 +1624,7 @@ static void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan) ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), VTY_NEWLINE); vty_out(vty, " Channel Mode / Codec: %s%s", - gsm48_chan_mode_name(lchan->tch_mode), + gsm48_chan_mode_name(lchan->current_ch_mode_rate.chan_mode), VTY_NEWLINE); if (lchan->conn && lchan->conn->bsub) { vty_out(vty, " Subscriber:%s", VTY_NEWLINE); @@ -6071,13 +6071,17 @@ static int lchan_act_single(struct vty *vty, struct gsm_lchan *lchan, const char if (!strcmp(codec_str, "hr") || !strcmp(codec_str, "fr")) { info = (struct lchan_activate_info) { .activ_for = ACTIVATE_FOR_VTY, - .chan_mode = GSM48_CMODE_SPEECH_V1, + .ch_mode_rate = { + .chan_mode = GSM48_CMODE_SPEECH_V1, + }, .requires_voice_stream = false, }; } else if (!strcmp(codec_str, "efr")) { info = (struct lchan_activate_info) { .activ_for = ACTIVATE_FOR_VTY, - .chan_mode = GSM48_CMODE_SPEECH_EFR, + .ch_mode_rate = { + .chan_mode = GSM48_CMODE_SPEECH_EFR, + }, .requires_voice_stream = false, }; } else if (!strcmp(codec_str, "amr")) { @@ -6087,14 +6091,18 @@ static int lchan_act_single(struct vty *vty, struct gsm_lchan *lchan, const char } info = (struct lchan_activate_info) { .activ_for = ACTIVATE_FOR_VTY, - .chan_mode = GSM48_CMODE_SPEECH_AMR, - .s15_s0 = amr_modes[amr_mode], + .ch_mode_rate = { + .chan_mode = GSM48_CMODE_SPEECH_AMR, + .s15_s0 = amr_modes[amr_mode], + }, .requires_voice_stream = false, }; } else if (!strcmp(codec_str, "sig")) { info = (struct lchan_activate_info) { .activ_for = ACTIVATE_FOR_VTY, - .chan_mode = GSM48_CMODE_SIGN, + .ch_mode_rate = { + .chan_mode = GSM48_CMODE_SIGN, + }, .requires_voice_stream = false, }; } else { @@ -6102,6 +6110,8 @@ static int lchan_act_single(struct vty *vty, struct gsm_lchan *lchan, const char return CMD_WARNING; } + info.ch_mode_rate.chan_rate = chan_t_to_chan_rate(lchan_t); + vty_out(vty, "%% activating lchan %s as %s%s", gsm_lchan_name(lchan), gsm_chan_t_name(lchan->type), VTY_NEWLINE); lchan_activate(lchan, &info); |