fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/34993?usp=email )
Change subject: trxcon/l1sched: tx_tch[fh]_fn(): fix sending idle CSD frames ......................................................................
trxcon/l1sched: tx_tch[fh]_fn(): fix sending idle CSD frames
In accordance with 3GPP TS 44.021, sections 8.1.6 and 10.2.3, the transmission of idle frames to the DTE is mandated when no data is received from the radio interface. An idle frame has all data, status, and E-bits to binary '1' (excluding the alignment pattern).
This requirement is currently implemented by osmo-bts for the Uplink, and is going to be adopted for the Downlink (see the related patch).
This patch brings trxcon/l1sched in sync with osmo-bts-trx.
Change-Id: I7dea3dde46bc02814e99c3e873298cc7ed045a51 Related: osmo-bts.git I0b25cfac41b6d8dcf3bfd9d46d51a9665f1b047a Related: OS#1572, OS#4396 --- M src/host/trxcon/src/sched_lchan_tchf.c M src/host/trxcon/src/sched_lchan_tchh.c 2 files changed, 52 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/93/34993/1
diff --git a/src/host/trxcon/src/sched_lchan_tchf.c b/src/host/trxcon/src/sched_lchan_tchf.c index ac9ee6b..909804e 100644 --- a/src/host/trxcon/src/sched_lchan_tchf.c +++ b/src/host/trxcon/src/sched_lchan_tchf.c @@ -335,7 +335,11 @@ gsm0503_tch_fr144_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm data sending (pass ownership of the msgb/prim) */ l1sched_lchan_emit_data_cnf(lchan, msg, br->fn); - } /* else: all bits of this frame are set to zero */ + } else { + ubit_t idle[290]; + memset(&idle[0], 0x01, sizeof(idle)); + gsm0503_tch_fr144_encode(BUFPOS(bursts_p, 0), &idle[0]); + } if ((msg = msg_facch) != NULL) { gsm0503_tch_fr_facch_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm FACCH sending (pass ownership of the msgb/prim) */ @@ -349,7 +353,11 @@ gsm0503_tch_fr96_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm data sending (pass ownership of the msgb/prim) */ l1sched_lchan_emit_data_cnf(lchan, msg, br->fn); - } /* else: all bits of this frame are set to zero */ + } else { + ubit_t idle[4 * 60]; + memset(&idle[0], 0x01, sizeof(idle)); + gsm0503_tch_fr96_encode(BUFPOS(bursts_p, 0), &idle[0]); + } if ((msg = msg_facch) != NULL) { gsm0503_tch_fr_facch_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm FACCH sending (pass ownership of the msgb/prim) */ @@ -363,7 +371,11 @@ gsm0503_tch_fr48_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm data sending (pass ownership of the msgb/prim) */ l1sched_lchan_emit_data_cnf(lchan, msg, br->fn); - } /* else: all bits of this frame are set to zero */ + } else { + ubit_t idle[2 * 60]; + memset(&idle[0], 0x01, sizeof(idle)); + gsm0503_tch_fr48_encode(BUFPOS(bursts_p, 0), &idle[0]); + } if ((msg = msg_facch) != NULL) { gsm0503_tch_fr_facch_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm FACCH sending (pass ownership of the msgb/prim) */ @@ -372,14 +384,16 @@ goto send_burst; /* CSD (TCH/F2.4): 3.6 kbit/s radio interface rate */ case GSM48_CMODE_DATA_3k6: - if (msg == NULL) - goto send_burst; - if (msg == msg_facch) { + if (msg_facch != NULL) { /* FACCH/F does steal a TCH/F2.4 frame completely */ rc = gsm0503_tch_fr_facch_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); - } else { + } else if (msg_tch != NULL) { OSMO_ASSERT(msgb_l2len(msg) == 2 * 36); rc = gsm0503_tch_fr24_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); + } else { + ubit_t idle[2 * 36]; + memset(&idle[0], 0x01, sizeof(idle)); + gsm0503_tch_fr24_encode(BUFPOS(bursts_p, 0), &idle[0]); } break; default: diff --git a/src/host/trxcon/src/sched_lchan_tchh.c b/src/host/trxcon/src/sched_lchan_tchh.c index 0932cce..99e2680 100644 --- a/src/host/trxcon/src/sched_lchan_tchh.c +++ b/src/host/trxcon/src/sched_lchan_tchh.c @@ -542,7 +542,11 @@ gsm0503_tch_hr48_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm data sending (pass ownership of the msgb/prim) */ l1sched_lchan_emit_data_cnf(lchan, msg, br->fn); - } /* else: all bits of this frame are set to zero */ + } else { + ubit_t idle[4 * 60]; + memset(&idle[0], 0x01, sizeof(idle)); + gsm0503_tch_hr48_encode(BUFPOS(bursts_p, 0), &idle[0]); + } if ((msg = msg_facch) != NULL) { gsm0503_tch_hr_facch_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm FACCH sending (pass ownership of the msgb/prim) */ @@ -556,7 +560,11 @@ gsm0503_tch_hr24_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm data sending (pass ownership of the msgb/prim) */ l1sched_lchan_emit_data_cnf(lchan, msg, br->fn); - } /* else: all bits of this frame are set to zero */ + } else { + ubit_t idle[4 * 36]; + memset(&idle[0], 0x01, sizeof(idle)); + gsm0503_tch_hr24_encode(BUFPOS(bursts_p, 0), &idle[0]); + } if ((msg = msg_facch) != NULL) { gsm0503_tch_hr_facch_encode(BUFPOS(bursts_p, 0), msgb_l2(msg)); /* Confirm FACCH sending (pass ownership of the msgb/prim) */