diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-04-15 11:05:45 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-04-15 11:09:25 +0200 |
commit | 9abc5f79826c9dd9a918caaa69afd33cca0867f1 (patch) | |
tree | fcc89f94929e45f99149a8bceb6a3f829003d990 | |
parent | 9803a35a8a3332f32f1dd2e9cd5c5e591a31b095 (diff) |
trxcon: Prefix SACCH fill frame with L1 header
The main problem here is that the existing implementatin missing the L1
header in this message. A SACCH message doesn't have a 23byte LAPDm
message, but only a 21 byte LAPDm message prefixed by a 2-byte Layer1
header. So on the receiver in the BTS, right now the first two bytes of
the UL SACCH frame are misinterpreted as L1 header.
This it what causes RLL ERROR INDICATION on the Abis side, which is why
our BTS_Tests fail.
Change-Id: Id7776bf3604d0e8a32e04547e01b8bd377903272
Related: OS#3170
-rw-r--r-- | src/host/trxcon/sched_prim.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c index e1c87bbf..2ee06d73 100644 --- a/src/host/trxcon/sched_prim.c +++ b/src/host/trxcon/sched_prim.c @@ -275,8 +275,18 @@ int sched_prim_dummy(struct trx_lchan_state *lchan) /* FIXME: should we do anything for CSD? */ return 0; } else { + uint8_t *cur = prim_buffer; + + if (CHAN_IS_SACCH(chan)) { + /* Add 2-byte SACCH header */ + /* FIXME: How to get TA and MS Tx Power from l1l->trx->tx_power + l1l->trx->ta? */ + cur[0] = cur[1] = 0x00; + cur += 2; + } + /* Copy a fill frame payload */ - memcpy(prim_buffer, lapdm_fill_frame, sizeof(lapdm_fill_frame)); + memcpy(cur, lapdm_fill_frame, sizeof(lapdm_fill_frame)); + cur += sizeof(lapdm_fill_frame); /** * TS 144.006, section 5.2 "Frame delimitation and fill bits" @@ -284,7 +294,7 @@ int sched_prim_dummy(struct trx_lchan_state *lchan) * be set to the binary value "00101011", each fill bit should * be set to a random value when sent by the network. */ - for (i = sizeof(lapdm_fill_frame); i < GSM_MACBLOCK_LEN; i++) + for (i = cur - prim_buffer; i < GSM_MACBLOCK_LEN; i++) prim_buffer[i] = (uint8_t) rand(); /* Define a prim length */ |