fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/33667 )


Change subject: fix bts_supports_cm(): properly check feature flags for VGCS/VBS
......................................................................

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
---
M src/common/bts.c
1 file changed, 42 insertions(+), 15 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/33667/1

diff --git a/src/common/bts.c b/src/common/bts.c
index 0ca4b6d..2f17e0a 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -791,6 +791,13 @@
                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 @@
                if (!osmo_bts_has_feature(bts->features, BTS_FEAT_VBS))
                        return false;
                break;
-       case RSL_CMOD_SPD_DATA:
-       default:
-               return false;
-       }
-
-       /* Before the requested pchan/cm combination can be checked, we need to
-        * convert it to a feature identifier we can check */
-       switch (cm->chan_rt) {
        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;
-               /* fall-through */
-       case RSL_CMOD_CRT_TCH_Bm:
+               break;
+       }
+
+       /* Stage 2: check support for the requested codec */
+       switch (cm->chan_rt) {
+       case RSL_CMOD_CRT_OSMO_TCH_VAMOS_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;
@@ -832,13 +837,9 @@
                }
                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;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33667
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I914c84be04da819df9e60e2f5ecc5bac9b61b2e5
Gerrit-Change-Number: 33667
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to