diff --git a/lib/src/mac/mac_sch_pdu_nr.cc b/lib/src/mac/mac_sch_pdu_nr.cc index 268e8ebd8..f87289230 100644 --- a/lib/src/mac/mac_sch_pdu_nr.cc +++ b/lib/src/mac/mac_sch_pdu_nr.cc @@ -254,12 +254,14 @@ uint32_t mac_sch_subpdu_nr::sizeof_ce(uint32_t lcid, bool is_ul) return 8; case CRNTI: return 2; - case SHORT_TRUNC_BSR: - return 1; case SHORT_BSR: + case SHORT_TRUNC_BSR: return 1; case SE_PHR: return 2; + case LONG_BSR: + case LONG_TRUNC_BSR: + return 1; // minimum size, could be more than that case PADDING: return 0; } diff --git a/srsue/src/stack/mac_nr/proc_bsr_nr.cc b/srsue/src/stack/mac_nr/proc_bsr_nr.cc index 391264be7..b292476a9 100644 --- a/srsue/src/stack/mac_nr/proc_bsr_nr.cc +++ b/srsue/src/stack/mac_nr/proc_bsr_nr.cc @@ -219,11 +219,14 @@ void proc_bsr_nr::set_padding_bytes(uint32_t nof_bytes) const uint32_t LBSR_CE_SUBHEADER_LEN = 1; // if the number of padding bits is equal to or larger than the size of the Short BSR plus its subheader but smaller // than the size of the Long BSR plus its subheader - if (nof_bytes >= SBSR_CE_SUBHEADER_LEN + srsran::mac_sch_subpdu_nr::sizeof_ce(SHORT_BSR, true) && - nof_bytes < LBSR_CE_SUBHEADER_LEN + srsran::mac_sch_subpdu_nr::sizeof_ce(LONG_BSR, true)) { + if (nof_bytes >= (SBSR_CE_SUBHEADER_LEN + + srsran::mac_sch_subpdu_nr::sizeof_ce(srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::SHORT_BSR, true)) && + nof_bytes < (LBSR_CE_SUBHEADER_LEN + + srsran::mac_sch_subpdu_nr::sizeof_ce(srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::LONG_BSR, true))) { // generate short padding BSR mux->generate_bsr_mac_ce(SHORT_BSR); - } else if (nof_bytes >= LBSR_CE_SUBHEADER_LEN + srsran::mac_sch_subpdu_nr::sizeof_ce(LONG_BSR, true)) { + } else if (nof_bytes >= (LBSR_CE_SUBHEADER_LEN + srsran::mac_sch_subpdu_nr::sizeof_ce( + srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::LONG_BSR, true))) { // report Long BSR if more than one LCG has data to send mux->generate_bsr_mac_ce(LONG_BSR); }