Commit 0965e86a authored by francescomani's avatar francescomani

schedule CSI-RS only once per BWP

parent 93d6ae6d
...@@ -60,7 +60,7 @@ const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon ...@@ -60,7 +60,7 @@ const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon
AssertFatal(tdd || nrmac->common_channels->frame_type == FDD, "Dynamic TDD not handled yet\n"); AssertFatal(tdd || nrmac->common_channels->frame_type == FDD, "Dynamic TDD not handled yet\n");
// Use special TDA in case of CSI-RS // Use special TDA in case of CSI-RS
if(nrmac->UE_info.sched_csirs) if(nrmac->UE_info.sched_csirs > 0)
return 1; return 1;
if (tdd && tdd->nrofDownlinkSymbols > 1) { // if there is a mixed slot where we can transmit DL if (tdd && tdd->nrofDownlinkSymbols > 1) { // if there is a mixed slot where we can transmit DL
......
...@@ -2552,18 +2552,23 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo ...@@ -2552,18 +2552,23 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
uint16_t *vrb_map = gNB_mac->common_channels[CC_id].vrb_map; uint16_t *vrb_map = gNB_mac->common_channels[CC_id].vrb_map;
UE_info->sched_csirs = false; UE_info->sched_csirs = 0;
UE_iterator(UE_info->list, UE) { UE_iterator(UE_info->list, UE) {
NR_UE_DL_BWP_t *dl_bwp = &UE->current_DL_BWP;
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
// CSI-RS is common to all UEs in a given BWP
// therefore we need to schedule only once per BWP
// the following condition verifies if CSI-RS
// has been already scheduled in this BWP
if (UE_info->sched_csirs & (1 << dl_bwp->bwp_id))
continue;
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
if (sched_ctrl->rrc_processing_timer > 0) { if (sched_ctrl->rrc_processing_timer > 0) {
continue; continue;
} }
NR_UE_DL_BWP_t *dl_bwp = &UE->current_DL_BWP;
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
if (!ul_bwp->csi_MeasConfig) continue; if (!ul_bwp->csi_MeasConfig) continue;
NR_CSI_MeasConfig_t *csi_measconfig = ul_bwp->csi_MeasConfig; NR_CSI_MeasConfig_t *csi_measconfig = ul_bwp->csi_MeasConfig;
...@@ -2598,8 +2603,9 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo ...@@ -2598,8 +2603,9 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
if((frame*n_slots_frame+slot-offset)%period == 0) { if((frame*n_slots_frame+slot-offset)%period == 0) {
LOG_D(NR_MAC,"Scheduling CSI-RS in frame %d slot %d Resource ID %ld\n",frame,slot,nzpcsi->nzp_CSI_RS_ResourceId); LOG_D(NR_MAC,"Scheduling CSI-RS in frame %d slot %d Resource ID %ld\n",
UE_info->sched_csirs = true; frame, slot, nzpcsi->nzp_CSI_RS_ResourceId);
UE_info->sched_csirs |= (1 << dl_bwp->bwp_id);
nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
......
...@@ -691,7 +691,8 @@ typedef struct { ...@@ -691,7 +691,8 @@ typedef struct {
// last element always NULL // last element always NULL
pthread_mutex_t mutex; pthread_mutex_t mutex;
NR_UE_info_t *list[MAX_MOBILES_PER_GNB+1]; NR_UE_info_t *list[MAX_MOBILES_PER_GNB+1];
bool sched_csirs; // bitmap of CSI-RS already scheduled in current slot
int sched_csirs;
uid_allocator_t uid_allocator; uid_allocator_t uid_allocator;
} NR_UEs_t; } NR_UEs_t;
......
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