summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-05-20 14:16:26 +0500
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-05-20 14:16:28 +0500
commit7c00190b45205c2f1d2d8e708c1f6e9dd621ff69 (patch)
treeba9777f10541a55f26b325558d70b772aa726e72 /src/host/trxcon/src
parent5250da87adb94479af71783bd5fe7a68d53d1221 (diff)
trxcon/l1sched: fix sending dummy TCH/A[FH]S blocks
... in the absence of valid Uplink TCH/A[FH]S or FACCH frames. Change-Id: I26205e8672cb2849ea79bd6206c1eff1172bd9d9 Related: libosmocore.git I82ce2adf995a4b42d1f378c5819f88d773b9104a Related: OS#6049
Diffstat (limited to 'src/host/trxcon/src')
-rw-r--r--src/host/trxcon/src/sched_lchan_tchf.c9
-rw-r--r--src/host/trxcon/src/sched_lchan_tchh.c9
2 files changed, 4 insertions, 14 deletions
diff --git a/src/host/trxcon/src/sched_lchan_tchf.c b/src/host/trxcon/src/sched_lchan_tchf.c
index 37e0cea3..d11b3146 100644
--- a/src/host/trxcon/src/sched_lchan_tchf.c
+++ b/src/host/trxcon/src/sched_lchan_tchf.c
@@ -305,13 +305,7 @@ int tx_tchf_fn(struct l1sched_lchan_state *lchan,
const uint8_t *data = msg ? msgb_l2(msg) : NULL;
size_t data_len = msg ? msgb_l2len(msg) : 0;
- if (msg == NULL) {
- /* TODO: It's not clear what to do for TCH/AFS.
- * TODO: Send dummy FACCH maybe? */
- goto send_burst; /* send something */
- }
-
- if (data_len != GSM_MACBLOCK_LEN) { /* TCH/AFS: speech */
+ if (msg != NULL && msg != msg_facch) { /* TCH/AFS: speech */
if (!l1sched_lchan_amr_prim_is_valid(lchan, msg, amr_fn_is_cmr))
goto free_bad_msg;
/* pull the AMR header - sizeof(struct amr_hdr) */
@@ -319,6 +313,7 @@ int tx_tchf_fn(struct l1sched_lchan_state *lchan,
data += 2;
}
+ /* if msg == NULL, transmit a dummy speech block with inverted CRC6 */
rc = gsm0503_tch_afs_encode(BUFPOS(bursts_p, 0),
data, data_len,
amr_fn_is_cmr,
diff --git a/src/host/trxcon/src/sched_lchan_tchh.c b/src/host/trxcon/src/sched_lchan_tchh.c
index 99e26808..0d3de003 100644
--- a/src/host/trxcon/src/sched_lchan_tchh.c
+++ b/src/host/trxcon/src/sched_lchan_tchh.c
@@ -512,13 +512,7 @@ int tx_tchh_fn(struct l1sched_lchan_state *lchan,
const uint8_t *data = msg ? msgb_l2(msg) : NULL;
size_t data_len = msg ? msgb_l2len(msg) : 0;
- if (msg == NULL) {
- /* TODO: It's not clear what to do for TCH/AHS.
- * TODO: Send dummy FACCH maybe? */
- goto send_burst; /* send garbage */
- }
-
- if (data_len != GSM_MACBLOCK_LEN) { /* TCH/AHS: speech */
+ if (msg != NULL && msg != msg_facch) { /* TCH/AHS: speech */
if (!l1sched_lchan_amr_prim_is_valid(lchan, msg, amr_fn_is_cmr))
goto free_bad_msg;
/* pull the AMR header - sizeof(struct amr_hdr) */
@@ -526,6 +520,7 @@ int tx_tchh_fn(struct l1sched_lchan_state *lchan,
data += 2;
}
+ /* if msg == NULL, transmit a dummy speech block with inverted CRC6 */
rc = gsm0503_tch_ahs_encode(BUFPOS(bursts_p, 0),
data, data_len,
amr_fn_is_cmr,