fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30332 )
Change subject: mobile: properly handle RR CHANNEL MODE MODIFY message
......................................................................
mobile: properly handle RR CHANNEL MODE MODIFY message
According to 3GPP TS 04.08, section 3.4.6.1.3 "Abnormal cases"
of "channel mode modify procedure", if the MS doesn't support
the indicated channel mode, it shall retain the old mode and
return the associated channel mode information in the
ACKNOWLEDGE message.
Previously, if an indicated mode is not supported, we used to
indicate the 'CHAN_MODE_UNACCT' RR case without sending the
ACKNOWLEDGE message. Also, the result of gsm48_rr_set_mode()
was ignored. Let's fix this!
Change-Id: I952436ec796273e56341f9d3492b4a3b3a5dc410
Related: OS#5599
---
M src/host/layer23/src/mobile/gsm48_rr.c
1 file changed, 24 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/32/30332/1
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index 2ddc130..223188d 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -3573,7 +3573,7 @@
int payload_len = msgb_l3len(msg) - sizeof(*gh) - sizeof(*cm);
struct gsm48_rr_cd *cd = &rr->cd_now;
uint8_t ch_type, ch_subch, ch_ts;
- uint8_t cause;
+ int rc;
LOGP(DRR, LOGL_INFO, "CHANNEL MODE MODIFY\n");
@@ -3605,14 +3605,30 @@
gsm_print_arfcn(cd->arfcn), ch_ts, ch_subch, cd->tsc,
cm->mode);
}
- /* mode */
- cause = gsm48_rr_check_mode(ms, cd->chan_nr, cm->mode);
- if (cause)
- return gsm48_rr_tx_rr_status(ms, cause);
- cd->mode = cm->mode;
- gsm48_rr_set_mode(ms, cd->chan_nr, cd->mode);
- return gsm48_rr_tx_chan_modify_ack(ms, &cm->chan_desc, cm->mode);
+ /**
+ * According to 3GPP TS 04.08, section 3.4.6.1.3
+ * "Abnormal cases" of "channel mode modify procedure",
+ * if the MS doesn't support the indicated channel mode,
+ * it shall retain the old mode and return the associated
+ * channel mode information in the ACKNOWLEDGE message.
+ */
+
+ /* Check if we support this channel mode */
+ rc = gsm48_rr_check_mode(ms, cd->chan_nr, cm->mode);
+ if (rc)
+ goto ack;
+
+ /* Attempt to apply this mode */
+ rc = gsm48_rr_set_mode(ms, cd->chan_nr, cm->mode);
+ if (rc)
+ goto ack;
+
+ /* Finally set (a new) mode */
+ cd->mode = cm->mode;
+
+ack:
+ return gsm48_rr_tx_chan_modify_ack(ms, &cm->chan_desc, cd->mode);
}
/* 9.1.3 sending ASSIGNMENT COMPLETE */
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30332
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I952436ec796273e56341f9d3492b4a3b3a5dc410
Gerrit-Change-Number: 30332
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: fixeria <axilirator(a)gmail.com>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30330 )
Change subject: mobile: gsm48_rr_set_mode(): print error if ch_type is not TCH
......................................................................
mobile: gsm48_rr_set_mode(): print error if ch_type is not TCH
The CHANNEL MODE MODIFY message only applies to TCH channels,
and in general should not arrive on non-traffic channels. Let's
print error message if this happens in order to facilitate
finding possible bugs.
Change-Id: I4ab63c4ae4262c8166de37e4873fc3f1b8ec6fe7
Related: OS#5599
---
M src/host/layer23/src/mobile/gsm48_rr.c
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/30/30330/1
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index e7722f1..e8c998d 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -3437,9 +3437,11 @@
}
/* only apply mode to TCH/F or TCH/H */
- if (ch_type != RSL_CHAN_Bm_ACCHs
- && ch_type != RSL_CHAN_Lm_ACCHs)
+ if (ch_type != RSL_CHAN_Bm_ACCHs && ch_type != RSL_CHAN_Lm_ACCHs) {
+ LOGP(DRR, LOGL_ERROR, "CHANNEL MODE MODIFY only applies "
+ "to TCH channels, ignoring...\n");
return -ENOTSUP;
+ }
/* setting (new) timing advance */
LOGP(DRR, LOGL_INFO, "setting TCH mode to %s, audio mode to %d\n",
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30330
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I4ab63c4ae4262c8166de37e4873fc3f1b8ec6fe7
Gerrit-Change-Number: 30330
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: fixeria <axilirator(a)gmail.com>
Gerrit-MessageType: newchange