Commit 77e2a5aa authored by Robert Schmidt's avatar Robert Schmidt

Simplify allocate_rn_CCEs()

parent 5efe4751
...@@ -689,8 +689,7 @@ void nr_generate_Msg2(module_id_t module_idP, ...@@ -689,8 +689,7 @@ void nr_generate_Msg2(module_id_t module_idP,
bwp, bwp,
coreset, coreset,
aggregation_level, aggregation_level,
ss->searchSpaceType->present - 1, // 0 common, 1 ue-specific 0, /* n_RNTI 0: common search space */
UE_id,
0); // m 0); // m
if (CCEIndex < 0) { if (CCEIndex < 0) {
......
...@@ -494,8 +494,7 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id, ...@@ -494,8 +494,7 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
sched_ctrl->active_bwp, sched_ctrl->active_bwp,
sched_ctrl->coreset, sched_ctrl->coreset,
sched_ctrl->aggregation_level, sched_ctrl->aggregation_level,
sched_ctrl->search_space->searchSpaceType->present - 1, UE_info->rnti[UE_id],
UE_id,
0); // m 0); // m
if (sched_ctrl->cce_index < 0) { if (sched_ctrl->cce_index < 0) {
LOG_E(MAC, "%s(): could not find CCE for UE %d\n", __func__, UE_id); LOG_E(MAC, "%s(): could not find CCE for UE %d\n", __func__, UE_id);
......
...@@ -422,8 +422,7 @@ int configure_fapi_dl_pdu_phytest(int Mod_idP, ...@@ -422,8 +422,7 @@ int configure_fapi_dl_pdu_phytest(int Mod_idP,
bwp, bwp,
coreset, coreset,
aggregation_level, aggregation_level,
ss->searchSpaceType->present - 1, // 0 common, 1 ue-specific UE_info->rnti[UE_id],
UE_id,
0); // m 0); // m
if (CCEIndex < 0) { if (CCEIndex < 0) {
LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PDSCH\n", __func__); LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PDSCH\n", __func__);
...@@ -1114,8 +1113,7 @@ void schedule_fapi_ul_pdu(int Mod_idP, ...@@ -1114,8 +1113,7 @@ void schedule_fapi_ul_pdu(int Mod_idP,
bwp, bwp,
coreset, coreset,
aggregation_level, aggregation_level,
ss->searchSpaceType->present - 1, // 0 common, 1 ue-specific UE_info->rnti[UE_id],
UE_id,
0); // m 0); // m
if (CCEIndex < 0) { if (CCEIndex < 0) {
LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PUSCH\n", __func__); LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PUSCH\n", __func__);
......
...@@ -173,17 +173,12 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, ...@@ -173,17 +173,12 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
NR_BWP_Downlink_t *bwp, NR_BWP_Downlink_t *bwp,
NR_ControlResourceSet_t *coreset, NR_ControlResourceSet_t *coreset,
int aggregation, int aggregation,
int search_space, // 0 common, 1 ue-specific uint16_t n_RNTI,
int UE_id,
int m) { int m) {
// uncomment these when we allocate for common search space // uncomment these when we allocate for common search space
// NR_COMMON_channels_t *cc = nr_mac->common_channels; // NR_COMMON_channels_t *cc = nr_mac->common_channels;
// NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; // NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
NR_UE_info_t *UE_info = &nr_mac->UE_info;
AssertFatal(UE_info->active[UE_id],"UE_id %d is not active\n",UE_id);
int coreset_id = coreset->controlResourceSetId; int coreset_id = coreset->controlResourceSetId;
int *cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id]; int *cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id];
...@@ -195,17 +190,14 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, ...@@ -195,17 +190,14 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
n_rb*=6; n_rb*=6;
uint16_t N_reg = n_rb * coreset->duration; uint16_t N_reg = n_rb * coreset->duration;
uint16_t Y=0, N_cce, M_s_max, n_CI=0; uint16_t n_CI=0;
uint16_t n_RNTI = search_space == 1 ? UE_info->rnti[UE_id]:0; const uint32_t A[3]={39827,39829,39839};
uint32_t A[3]={39827,39829,39839}; /* if n_RNTI is zero, this results in zero, too! */
uint16_t Y = (A[0]*n_RNTI)%65537; // Candidate 0, antenna port 0
N_cce = N_reg / NR_NB_REG_PER_CCE; uint16_t N_cce = N_reg / NR_NB_REG_PER_CCE;
M_s_max = (aggregation==4)?4:(aggregation==8)?2:1; uint16_t M_s_max = (aggregation==4)?4:(aggregation==8)?2:1;
if (search_space == 1) {
Y = (A[0]*n_RNTI)%65537; // Candidate 0, antenna port 0
}
int first_cce = aggregation * (( Y + (m*N_cce)/(aggregation*M_s_max) + n_CI ) % CEILIDIV(N_cce,aggregation)); int first_cce = aggregation * (( Y + (m*N_cce)/(aggregation*M_s_max) + n_CI ) % CEILIDIV(N_cce,aggregation));
for (int i=0;i<aggregation;i++) for (int i=0;i<aggregation;i++)
......
...@@ -311,8 +311,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, ...@@ -311,8 +311,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
NR_BWP_Downlink_t *bwp, NR_BWP_Downlink_t *bwp,
NR_ControlResourceSet_t *coreset, NR_ControlResourceSet_t *coreset,
int aggregation, int aggregation,
int search_space, // 0 common, 1 ue-specific uint16_t n_RNTI,
int UE_id,
int m); int m);
int get_dlscs(nfapi_nr_config_request_t *cfg); int get_dlscs(nfapi_nr_config_request_t *cfg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment