fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35696?usp=email )
Change subject: mobile: fix rate adaption checking for MO/MT CSD calls ......................................................................
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 --- M src/host/layer23/src/mobile/mnccms.c M src/host/layer23/src/mobile/tch_data.c 2 files changed, 50 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/96/35696/1
diff --git a/src/host/layer23/src/mobile/mnccms.c b/src/host/layer23/src/mobile/mnccms.c index 2a4989d..67cf5a7 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_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 06df85f..c93c828 100644 --- a/src/host/layer23/src/mobile/tch_data.c +++ b/src/host/layer23/src/mobile/tch_data.c @@ -426,8 +426,21 @@
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 @@ 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",