diff --git a/srsenb/hdr/stack/mac/mac.h b/srsenb/hdr/stack/mac/mac.h index 866c02979..c090e1fbe 100644 --- a/srsenb/hdr/stack/mac/mac.h +++ b/srsenb/hdr/stack/mac/mac.h @@ -139,6 +139,7 @@ private: void prealloc_ue(uint32_t nof_ue); uint8_t* assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, + uint32_t enb_cc_idx, uint32_t nof_grants, uint32_t rar_idx, uint32_t pdu_len, @@ -146,7 +147,7 @@ private: const static int rar_payload_len = 128; std::array rar_pdu_msg; - srslte::byte_buffer_t rar_payload[sched_interface::MAX_RAR_LIST]; + srslte::byte_buffer_t rar_payload[SRSLTE_MAX_CARRIERS][sched_interface::MAX_RAR_LIST]; const static int NOF_BCCH_DLSCH_MSG = sched_interface::MAX_SIBS; diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index a5ba36112..eafa34bf5 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -661,6 +661,7 @@ int mac::get_dl_sched(uint32_t tti_tx_dl, dl_sched_list_t& dl_sched_res_list) // Assemble PDU dl_sched_res->pdsch[n].data[0] = assemble_rar(sched_result.rar[i].msg3_grant.data(), + enb_cc_idx, sched_result.rar[i].msg3_grant.size(), i, sched_result.rar[i].tbs, @@ -830,6 +831,7 @@ int mac::get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res } uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, + uint32_t enb_cc_idx, uint32_t nof_grants, uint32_t rar_idx, uint32_t pdu_len, @@ -838,8 +840,8 @@ uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, uint8_t grant_buffer[64] = {}; if (pdu_len < rar_payload_len && rar_idx < rar_pdu_msg.size()) { srslte::rar_pdu* pdu = &rar_pdu_msg[rar_idx]; - rar_payload[rar_idx].clear(); - pdu->init_tx(&rar_payload[rar_idx], pdu_len); + rar_payload[enb_cc_idx][rar_idx].clear(); + pdu->init_tx(&rar_payload[enb_cc_idx][rar_idx], pdu_len); for (uint32_t i = 0; i < nof_grants; i++) { srslte_dci_rar_pack(&grants[i].grant, grant_buffer); if (pdu->new_subh()) { @@ -849,8 +851,8 @@ uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, pdu->get()->set_sched_grant(grant_buffer); } } - if (pdu->write_packet(rar_payload[rar_idx].msg)) { - return rar_payload[rar_idx].msg; + if (pdu->write_packet(rar_payload[enb_cc_idx][rar_idx].msg)) { + return rar_payload[enb_cc_idx][rar_idx].msg; } }