From c9c43e44e9d821c7dfb85c27c37986d92e7d1216 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Mon, 15 Jul 2019 18:03:28 +0200 Subject: [PATCH] Fixed PDU buffer size --- lib/include/srslte/common/common.h | 5 +++-- srsue/src/stack/rrc/rrc.cc | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/include/srslte/common/common.h b/lib/include/srslte/common/common.h index 77677fcba..ad68d15f6 100644 --- a/lib/include/srslte/common/common.h +++ b/lib/include/srslte/common/common.h @@ -63,9 +63,10 @@ // Cat 4 UE - Max number of DL-SCH transport block bits received within a TTI // 3GPP 36.306 Table 4.1.1 -#define SRSLTE_MAX_BUFFER_SIZE_BITS 150752 -#define SRSLTE_MAX_BUFFER_SIZE_BYTES (SRSLTE_MAX_BUFFER_SIZE_BITS/8) +#define SRSLTE_MAX_TBSIZE_BITS 150752 #define SRSLTE_BUFFER_HEADER_OFFSET 1020 +#define SRSLTE_MAX_BUFFER_SIZE_BITS (SRSLTE_MAX_TBSIZE_BITS + SRSLTE_BUFFER_HEADER_OFFSET) +#define SRSLTE_MAX_BUFFER_SIZE_BYTES (SRSLTE_MAX_TBSIZE_BITS / 8 + SRSLTE_BUFFER_HEADER_OFFSET) //#define SRSLTE_BUFFER_POOL_LOG_ENABLED diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 2d033313f..32ff6f88e 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -2091,7 +2091,7 @@ void rrc::write_pdu_pcch(unique_byte_buffer_t pdu) void rrc::process_pcch(unique_byte_buffer_t pdu) { - if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BITS) { + if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BYTES) { pcch_msg_s pcch_msg; asn1::bit_ref bref(pdu->msg, pdu->N_bytes); if (pcch_msg.unpack(bref) != asn1::SRSASN_SUCCESS or pcch_msg.msg.type().value != pcch_msg_type_c::types_opts::c1) { @@ -2148,7 +2148,7 @@ void rrc::process_pcch(unique_byte_buffer_t pdu) void rrc::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) { - if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BITS) { + if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BYTES) { //TODO: handle MCCH notifications and update MCCH if (0 == lcid && !serving_cell->has_mcch) { asn1::bit_ref bref(pdu->msg, pdu->N_bytes);