diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-07-11 03:40:07 +0700 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-07-11 04:09:31 +0700 |
commit | 2bdb2201f6a375c7254298ac2f38a2c22500701d (patch) | |
tree | 552bcb47a810e230457192d36dfdfa1367a71613 | |
parent | 84d220abc1c577ac273c0612cc03812ba353983f (diff) |
fix bts_supports_cm(): properly check feature flags for VGCS/VBS
cm->spd_ind can take only three values defined in enum rsl_cmod_spd:
0000 0001 RSL_CMOD_SPD_SPEECH
0000 0010 RSL_CMOD_SPD_DATA
0000 0011 RSL_CMOD_SPD_SIGN
According to 3GPP TS 48.058, section 9.3.6, all other values are
reserved, so expecting RSL_CMOD_CRT_TCH_{GROUP,BCAST}_{Lm,Bm} there
is wrong. These values are part of enum rsl_cmod_crt, so the right
field would be not cm->spd_ind, but cm->chan_rt.
Let's check these channel types in a separate stage, before checking
the requested codec. Group them with VAMOS specific types for the
sake of consistency.
Change-Id: I914c84be04da819df9e60e2f5ecc5bac9b61b2e5
Fixes: 44c94fdea "validate RSL "channel rate and type" against VGCS/VBS flags"
Related: OS#4851
-rw-r--r-- | src/common/bts.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/common/bts.c b/src/common/bts.c index 0ca4b6dd..18f742de 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -791,6 +791,13 @@ bool bts_supports_cm(const struct gsm_bts *bts, return true; case RSL_CMOD_SPD_SPEECH: break; + case RSL_CMOD_SPD_DATA: + default: + return false; + } + + /* Stage 1: check support for the requested channel type */ + switch (cm->chan_rt) { case RSL_CMOD_CRT_TCH_GROUP_Bm: case RSL_CMOD_CRT_TCH_GROUP_Lm: if (!osmo_bts_has_feature(bts->features, BTS_FEAT_VGCS)) @@ -801,21 +808,19 @@ bool bts_supports_cm(const struct gsm_bts *bts, if (!osmo_bts_has_feature(bts->features, BTS_FEAT_VBS)) return false; break; - case RSL_CMOD_SPD_DATA: - default: - return false; + case RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm: + case RSL_CMOD_CRT_OSMO_TCH_VAMOS_Lm: + if (!osmo_bts_has_feature(bts->features, BTS_FEAT_VAMOS)) + return false; + break; } - /* Before the requested pchan/cm combination can be checked, we need to - * convert it to a feature identifier we can check */ + /* Stage 2: check support for the requested codec */ switch (cm->chan_rt) { case RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm: - if (!osmo_bts_has_feature(bts->features, BTS_FEAT_VAMOS)) - return false; - /* fall-through */ - case RSL_CMOD_CRT_TCH_Bm: case RSL_CMOD_CRT_TCH_GROUP_Bm: case RSL_CMOD_CRT_TCH_BCAST_Bm: + case RSL_CMOD_CRT_TCH_Bm: switch (cm->chan_rate) { case RSL_CMOD_SP_GSM1: feature = BTS_FEAT_SPEECH_F_V1; @@ -833,12 +838,9 @@ bool bts_supports_cm(const struct gsm_bts *bts, break; case RSL_CMOD_CRT_OSMO_TCH_VAMOS_Lm: - if (!osmo_bts_has_feature(bts->features, BTS_FEAT_VAMOS)) - return false; - /* fall-through */ - case RSL_CMOD_CRT_TCH_Lm: case RSL_CMOD_CRT_TCH_GROUP_Lm: case RSL_CMOD_CRT_TCH_BCAST_Lm: + case RSL_CMOD_CRT_TCH_Lm: switch (cm->chan_rate) { case RSL_CMOD_SP_GSM1: feature = BTS_FEAT_SPEECH_H_V1; |