summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-01-25 20:38:12 +0700
committerfixeria <vyanitskiy@sysmocom.de>2024-01-26 14:29:44 +0000
commit4b496a8c1c2717ea529ea5adf7f0d6447fa19f3a (patch)
treede6d620cb6decdebe5eebaa1eec42ed25ffebccb /src/host/layer23/src
parent8fa524c39703d0e4a0810eb7918d6938296737d7 (diff)
mobile: fix rate adaption checking for MO/MT CSD calls
Currently we unconditionally expect the rate adaption (octet 5) in the Bearer Capability IE to be GSM48_BCAP_RA_V110_X30. This is correct for UDI (GSM48_BCAP_ITCAP_UNR_DIG_INF), but not for 3.1 kHz audio (GSM48_BCAP_ITCAP_3k1_AUDIO) and fax (GSM48_BCAP_ITCAP_FAX_G3) calls. For the later two it should be GSM48_BCAP_RA_NONE. Change-Id: I70d36b3540ed2469068e050809a17ed07b434ad7 Related: OS#4396
Diffstat (limited to 'src/host/layer23/src')
-rw-r--r--src/host/layer23/src/mobile/mnccms.c26
-rw-r--r--src/host/layer23/src/mobile/tch_data.c19
2 files changed, 34 insertions, 11 deletions
diff --git a/src/host/layer23/src/mobile/mnccms.c b/src/host/layer23/src/mobile/mnccms.c
index 2a4989d6..67cf5a72 100644
--- a/src/host/layer23/src/mobile/mnccms.c
+++ b/src/host/layer23/src/mobile/mnccms.c
@@ -414,12 +414,28 @@ static int mncc_handle_bcap_speech(const struct gsm_mncc_bearer_cap *bcap,
static int mncc_handle_bcap_data(const struct gsm_mncc_bearer_cap *bcap,
const struct gsm_settings *set)
{
- if (bcap->data.rate_adaption != GSM48_BCAP_RA_V110_X30) {
- LOGP(DMNCC, LOGL_ERROR,
- "%s(): Rate adaption (octet 5) 0x%02x is not supported\n",
- __func__, bcap->data.rate_adaption);
- return -ENOTSUP;
+ switch (bcap->transfer) {
+ case GSM48_BCAP_ITCAP_UNR_DIG_INF:
+ if (bcap->data.rate_adaption != GSM48_BCAP_RA_V110_X30) {
+ LOGP(DMNCC, LOGL_ERROR,
+ "%s(): Rate adaption (octet 5) 0x%02x is not supported\n",
+ __func__, bcap->data.rate_adaption);
+ return -ENOTSUP;
+ }
+ break;
+ case GSM48_BCAP_ITCAP_3k1_AUDIO:
+ case GSM48_BCAP_ITCAP_FAX_G3:
+ if (bcap->data.rate_adaption != GSM48_BCAP_RA_NONE) {
+ LOGP(DMNCC, LOGL_ERROR,
+ "%s(): Rate adaption (octet 5) 0x%02x was expected to be NONE\n",
+ __func__, bcap->data.rate_adaption);
+ return -ENOTSUP;
+ }
+ break;
+ default:
+ break;
}
+
if (bcap->data.sig_access != GSM48_BCAP_SA_I440_I450) {
LOGP(DMNCC, LOGL_ERROR,
"%s(): Signalling access protocol (octet 5) 0x%02x is not supported\n",
diff --git a/src/host/layer23/src/mobile/tch_data.c b/src/host/layer23/src/mobile/tch_data.c
index 06df85f2..c93c8285 100644
--- a/src/host/layer23/src/mobile/tch_data.c
+++ b/src/host/layer23/src/mobile/tch_data.c
@@ -426,8 +426,21 @@ static int tch_data_check_bcap(const struct gsm_mncc_bearer_cap *bcap)
switch (bcap->transfer) {
case GSM48_BCAP_ITCAP_UNR_DIG_INF:
+ if (bcap->data.rate_adaption != GSM48_BCAP_RA_V110_X30) {
+ LOGP(DCSD, LOGL_ERROR,
+ "%s(): Rate adaption (octet 5) 0x%02x is not supported\n",
+ __func__, bcap->data.rate_adaption);
+ return -ENOTSUP;
+ }
+ break;
case GSM48_BCAP_ITCAP_3k1_AUDIO:
case GSM48_BCAP_ITCAP_FAX_G3:
+ if (bcap->data.rate_adaption != GSM48_BCAP_RA_NONE) {
+ LOGP(DCSD, LOGL_ERROR,
+ "%s(): Rate adaption (octet 5) 0x%02x was expected to be NONE\n",
+ __func__, bcap->data.rate_adaption);
+ return -ENOTSUP;
+ }
break;
default:
LOGP(DCSD, LOGL_ERROR,
@@ -436,12 +449,6 @@ static int tch_data_check_bcap(const struct gsm_mncc_bearer_cap *bcap)
return -ENOTSUP;
}
- if (bcap->data.rate_adaption != GSM48_BCAP_RA_V110_X30) {
- LOGP(DCSD, LOGL_ERROR,
- "%s(): Rate adaption (octet 5) 0x%02x is not supported\n",
- __func__, bcap->data.rate_adaption);
- return -ENOTSUP;
- }
if (bcap->data.sig_access != GSM48_BCAP_SA_I440_I450) {
LOGP(DCSD, LOGL_ERROR,
"%s(): Signalling access protocol (octet 5) 0x%02x is not supported\n",