diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-01-29 16:39:21 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-02-08 00:45:38 +0100 |
commit | 6b356a58d1269fe4ad449bc868cbc734c6d2a28e (patch) | |
tree | 8736689113716ab1eebb56ef7055e4840700cf7b /src/encoding.cpp | |
parent | f2694b74c9af6e308d3886cd3c75864d101de8d4 (diff) |
tbf: Use TLLI as ID if TFI not yet assigned
Currently the old TFI is always used as ID when a
PACKET DOWNLINK ASSIGNMENT is generated. This fails
if the old TBF has not been fully assigned yet. The
MS will then ignore the PDA.
This commit changes write_packet_downlink_assignment to accept
an additional parameter old_tfi_is_valid and uses the new TBF's
TLLI instead of the olf TFI if that parameter is set to false.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/encoding.cpp')
-rw-r--r-- | src/encoding.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/encoding.cpp b/src/encoding.cpp index a5e50646..9471fff5 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -274,8 +274,9 @@ void Encoding::write_packet_uplink_assignment( /* generate downlink assignment */ void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, - uint8_t old_tfi, uint8_t old_downlink, struct gprs_rlcmac_tbf *tbf, - uint8_t poll, uint8_t rrbp, uint8_t alpha, uint8_t gamma, int8_t ta_idx, + bool old_tfi_is_valid, uint8_t old_tfi, uint8_t old_downlink, + struct gprs_rlcmac_tbf *tbf, uint8_t poll, uint8_t rrbp, + uint8_t alpha, uint8_t gamma, int8_t ta_idx, uint8_t ta_ts, bool use_egprs) { // Packet downlink assignment TS 44.060 11.2.7 @@ -295,9 +296,14 @@ void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, block->u.Packet_Downlink_Assignment.Exist_PERSISTENCE_LEVEL = 0x0; // PERSISTENCE_LEVEL: off - block->u.Packet_Downlink_Assignment.ID.UnionType = 0x0; // TFI = on - block->u.Packet_Downlink_Assignment.ID.u.Global_TFI.UnionType = old_downlink; // 0=UPLINK TFI, 1=DL TFI - block->u.Packet_Downlink_Assignment.ID.u.Global_TFI.u.UPLINK_TFI = old_tfi; // TFI + if (old_tfi_is_valid) { + block->u.Packet_Downlink_Assignment.ID.UnionType = 0x0; // TFI = on + block->u.Packet_Downlink_Assignment.ID.u.Global_TFI.UnionType = old_downlink; // 0=UPLINK TFI, 1=DL TFI + block->u.Packet_Downlink_Assignment.ID.u.Global_TFI.u.UPLINK_TFI = old_tfi; // TFI + } else { + block->u.Packet_Downlink_Assignment.ID.UnionType = 0x1; // TLLI + block->u.Packet_Downlink_Assignment.ID.u.TLLI = tbf->tlli(); + } block->u.Packet_Downlink_Assignment.MAC_MODE = 0x0; // Dynamic Allocation block->u.Packet_Downlink_Assignment.RLC_MODE = 0x0; // RLC acknowledged mode |