Refactor get_dl_tda and get_ul_tda to get TDD configuration stored in MAC
Co-authored-by: Guido Casati <guido.casati@firecell.io>
This commit is contained in:
committed by
Guido Casati
co-authored by
Guido Casati
parent
066559227d
commit
177732ca3a
@@ -52,20 +52,22 @@
|
||||
#define WORD 32
|
||||
//#define SIZE_OF_POINTER sizeof (void *)
|
||||
|
||||
int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot)
|
||||
int get_dl_tda(const gNB_MAC_INST *nrmac, int slot)
|
||||
{
|
||||
/* we assume that this function is mutex-protected from outside */
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
AssertFatal(tdd || nrmac->common_channels->frame_type == FDD, "Dynamic TDD not handled yet\n");
|
||||
const frame_structure_t *fs = &nrmac->frame_structure;
|
||||
|
||||
// Use special TDA in case of CSI-RS
|
||||
if(nrmac->UE_info.sched_csirs > 0)
|
||||
if (nrmac->UE_info.sched_csirs > 0)
|
||||
return 1;
|
||||
|
||||
if (tdd && tdd->nrofDownlinkSymbols > 1) { // if there is a mixed slot where we can transmit DL
|
||||
const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + 1;
|
||||
if ((slot % nr_slots_period) == tdd->nrofDownlinkSlots)
|
||||
if (fs->is_tdd) {
|
||||
int s = get_slot_idx_in_period(slot, fs);
|
||||
// if there is a mixed slot where we can transmit DL
|
||||
const tdd_bitmap_t *tdd_slot_bitmap = fs->period_cfg.tdd_slot_bitmap;
|
||||
if (tdd_slot_bitmap[s].num_dl_symbols > 1 && (tdd_slot_bitmap[s].slot_type == TDD_NR_MIXED_SLOT)) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return 0; // if FDD or not mixed slot in TDD, for now use default TDA
|
||||
}
|
||||
@@ -447,7 +449,7 @@ static bool allocate_dl_retransmission(module_id_t module_id,
|
||||
int pm_index = (curInfo->nrOfLayers < retInfo->nrOfLayers) ? curInfo->pm_index : retInfo->pm_index;
|
||||
|
||||
const int coresetid = sched_ctrl->coreset->controlResourceSetId;
|
||||
const int tda = get_dl_tda(nr_mac, scc, slot);
|
||||
const int tda = get_dl_tda(nr_mac, slot);
|
||||
AssertFatal(tda >= 0,"Unable to find PDSCH time domain allocation in list\n");
|
||||
|
||||
/* Check first whether the old TDA can be reused
|
||||
@@ -761,7 +763,7 @@ static void pf_dl(module_id_t module_id,
|
||||
sched_pdsch->dl_harq_pid = sched_ctrl->available_dl_harq.head;
|
||||
|
||||
/* MCS has been set above */
|
||||
sched_pdsch->time_domain_allocation = get_dl_tda(mac, scc, slot);
|
||||
sched_pdsch->time_domain_allocation = get_dl_tda(mac, slot);
|
||||
AssertFatal(sched_pdsch->time_domain_allocation>=0,"Unable to find PDSCH time domain allocation in list\n");
|
||||
|
||||
const int coresetid = sched_ctrl->coreset->controlResourceSetId;
|
||||
|
||||
Reference in New Issue
Block a user