fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/36879?usp=email )
Change subject: trxcon/l1sched: fix sending dummy TCH/A[FH]S blocks ......................................................................
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 --- M src/host/trxcon/src/sched_lchan_tchf.c M src/host/trxcon/src/sched_lchan_tchh.c 2 files changed, 17 insertions(+), 14 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/src/host/trxcon/src/sched_lchan_tchf.c b/src/host/trxcon/src/sched_lchan_tchf.c index 37e0cea..d11b314 100644 --- a/src/host/trxcon/src/sched_lchan_tchf.c +++ b/src/host/trxcon/src/sched_lchan_tchf.c @@ -305,13 +305,7 @@ 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 @@ 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 99e2680..0d3de00 100644 --- a/src/host/trxcon/src/sched_lchan_tchh.c +++ b/src/host/trxcon/src/sched_lchan_tchh.c @@ -512,13 +512,7 @@ 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 @@ 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,