fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bts/+/27835 )
Change subject: osmo-bts-trx: tx_tchh_fn(): make handling of FACCH/H cleaner
......................................................................
osmo-bts-trx: tx_tchh_fn(): make handling of FACCH/H cleaner
If set, chan_state->dl_ongoing_facch indicates that we're sending
the 2 (out of 6) middle bursts of FACCH/H. In this case there is
no room for encoding an additional frame, because both even and
odd numbered bits are occupied by a previously encoded FACCH/H.
Right after calling tch_dl_dequeue():
* do not check the dequeued message against NULL,
* do not compare the message length to GSM_MACBLOCK_LEN,
* immediately free() it and jump to the sending part.
Change-Id: Ib923b8f5cc1063e9fc18acd2bdd003fd09f4b70f
Related: SYS#5919, OS#4823
---
M src/osmo-bts-trx/sched_lchan_tchh.c
1 file changed, 9 insertions(+), 4 deletions(-)
Approvals:
laforge: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index dcfbe3e..0db9c18 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -391,8 +391,15 @@
/* dequeue a message to be transmitted */
msg = tch_dl_dequeue(l1ts, br);
+ /* if we're sending 2 middle bursts of FACCH/H */
+ if (chan_state->dl_ongoing_facch) {
+ msgb_free(msg); /* drop 2nd speech frame */
+ chan_state->dl_ongoing_facch = 0;
+ goto send_burst;
+ }
+
/* no message at all, send a dummy L2 frame on FACCH */
- if (msg == NULL && !chan_state->dl_ongoing_facch) {
+ if (msg == NULL) {
static const uint8_t dummy[GSM_MACBLOCK_LEN] = {
0x03, 0x03, 0x01, /* TODO: use randomized padding */
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
@@ -409,9 +416,7 @@
gsm0503_tch_hr_encode(*bursts_p, msg->l2h, msgb_l2len(msg));
chan_state->dl_ongoing_facch = 1; /* first of two TCH frames */
chan_state->dl_facch_bursts = 6;
- } else if (chan_state->dl_ongoing_facch) /* second of two TCH frames */
- chan_state->dl_ongoing_facch = 0; /* we are done with FACCH */
- else if (tch_mode == GSM48_CMODE_SPEECH_AMR)
+ } else if (tch_mode == GSM48_CMODE_SPEECH_AMR)
/* the first FN 4,13,21 or 5,14,22 defines that CMI is included
* in frame, the first FN 0,8,17 or 1,9,18 defines that CMR is
* included in frame. */
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/27835
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib923b8f5cc1063e9fc18acd2bdd003fd09f4b70f
Gerrit-Change-Number: 27835
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged