Commit ce2d9fe0 authored by kn.raju's avatar kn.raju

Added Beam index in FAPI PDUs

parent 4352c5b5
...@@ -450,7 +450,8 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -450,7 +450,8 @@ void nr_initiate_ra_proc(module_id_t module_idP,
uint8_t beam_index = ssb_index_from_prach(module_idP, uint8_t beam_index = ssb_index_from_prach(module_idP,
frameP, frameP,
slotP, slotP,
preamble_index, freq_index, preamble_index,
freq_index,
symbol); symbol);
int pr_found=0; int pr_found=0;
if (preamble_index == ra->preambles.preamble_list[beam_index]) { if (preamble_index == ra->preambles.preamble_list[beam_index]) {
...@@ -527,7 +528,7 @@ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){ ...@@ -527,7 +528,7 @@ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
start_meas(&mac->schedule_ra); start_meas(&mac->schedule_ra);
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
NR_COMMON_channels_t *cc = &mac->common_channels[CC_id]; NR_COMMON_channels_t *cc = &mac->common_channels[CC_id];
for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) { for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) {
NR_RA_t *ra = &cc->ra[i]; NR_RA_t *ra = &cc->ra[i];
LOG_D(MAC,"RA[state:%d]\n",ra->state); LOG_D(MAC,"RA[state:%d]\n",ra->state);
...@@ -592,10 +593,8 @@ void nr_schedule_reception_msg3(module_id_t module_idP, int CC_id, frame_t frame ...@@ -592,10 +593,8 @@ void nr_schedule_reception_msg3(module_id_t module_idP, int CC_id, frame_t frame
gNB_MAC_INST *mac = RC.nrmac[module_idP]; gNB_MAC_INST *mac = RC.nrmac[module_idP];
nfapi_nr_ul_tti_request_t *ul_req = &mac->UL_tti_req[0]; nfapi_nr_ul_tti_request_t *ul_req = &mac->UL_tti_req[0];
NR_COMMON_channels_t *cc = &mac->common_channels[CC_id]; NR_COMMON_channels_t *cc = &mac->common_channels[CC_id];
// NR_RA_t *ra = &cc->ra[0]; for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) {
for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) { NR_RA_t *ra = &cc->ra[i];
NR_RA_t *ra = &cc->ra[i];
if (ra->state == WAIT_Msg3) { if (ra->state == WAIT_Msg3) {
if ((frameP == ra->Msg3_frame) && (slotP == ra->Msg3_slot) ){ if ((frameP == ra->Msg3_frame) && (slotP == ra->Msg3_slot) ){
ul_req->SFN = ra->Msg3_frame; ul_req->SFN = ra->Msg3_frame;
...@@ -606,7 +605,7 @@ void nr_schedule_reception_msg3(module_id_t module_idP, int CC_id, frame_t frame ...@@ -606,7 +605,7 @@ void nr_schedule_reception_msg3(module_id_t module_idP, int CC_id, frame_t frame
ul_req->n_pdus+=1; ul_req->n_pdus+=1;
} }
} }
} }
} }
void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP,NR_RA_t *ra,uint8_t RAR_pdu_index){ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP,NR_RA_t *ra,uint8_t RAR_pdu_index){
...@@ -784,8 +783,6 @@ void nr_generate_Msg2(module_id_t module_idP, ...@@ -784,8 +783,6 @@ void nr_generate_Msg2(module_id_t module_idP,
for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) { for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) {
NR_RA_t *ra = &cc->ra[i]; NR_RA_t *ra = &cc->ra[i];
if (ra->state == Msg2) { if (ra->state == Msg2) {
// NR_UE_list_t *UE_list = &nr_mac->UE_list;
// NR_SearchSpace_t *ss = ra->ra_ss;
uint16_t RA_rnti = ra->RA_rnti; uint16_t RA_rnti = ra->RA_rnti;
long locationAndBandwidth; long locationAndBandwidth;
...@@ -876,58 +873,38 @@ void nr_generate_Msg2(module_id_t module_idP, ...@@ -876,58 +873,38 @@ void nr_generate_Msg2(module_id_t module_idP,
pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex; pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex;
pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols; pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols;
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, scc->dmrs_TypeA_Position, NrOfSymbols); pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, scc->dmrs_TypeA_Position, NrOfSymbols);
pdsch_pdu_rel15->precodingAndBeamforming.numPRGs = 1; pdsch_pdu_rel15->precodingAndBeamforming.numPRGs = 1;
pdsch_pdu_rel15->precodingAndBeamforming.prgSize = 275; pdsch_pdu_rel15->precodingAndBeamforming.prgSize = 275;
pdsch_pdu_rel15->precodingAndBeamforming.digBFInterfaces = 1; pdsch_pdu_rel15->precodingAndBeamforming.digBFInterfaces = 1;
pdsch_pdu_rel15->precodingAndBeamforming.PMIdx[0] = 0; pdsch_pdu_rel15->precodingAndBeamforming.PMIdx[0] = 0;
pdsch_pdu_rel15->precodingAndBeamforming.beamIdx[0] = ra->beam_id; pdsch_pdu_rel15->precodingAndBeamforming.beamIdx[0] = ra->beam_id;
#if 1
nr_configure_dci(nr_mac, uint8_t nr_of_candidates, aggregation_level;
pdcch_pdu_rel15, find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss);
RA_rnti, NR_ControlResourceSet_t *coreset = get_coreset(bwp, ss, 0 /* common */);
ss, int CCEIndex = allocate_nr_CCEs(nr_mac,
coreset, bwp,
scc, bwp, coreset,
ra->beam_id, aggregation_level,
aggregation_level, 0, /* n_RNTI 0: common search space */
CCEIndex); 0); // m
#else
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].RNTI=RA_rnti; if (CCEIndex < 0) {
LOG_E(MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti);
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].ScramblingId = *scc->physCellId; return;
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].ScramblingRNTI=0;
uint8_t nr_of_candidates,aggregation_level;
int CCEIndex = -1;
find_aggregation_candidates(&aggregation_level,
&nr_of_candidates,
ss);
CCEIndex = allocate_nr_CCEs(nr_mac,
1, // bwp_id
0,
aggregation_level,
ss->searchSpaceType->present-1, // search_space, 0 common, 1 ue-specific
UE_id, // UE-id
0); // m
if(CCEIndex < 0) {
LOG_I(MAC, "[RAPROC] Subframe %d: CCE allocation is not feasible , skip scheduling UE %d\n", slotP, RA_rnti);
return;
} }
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].AggregationLevel = aggregation_level; nr_configure_dci(nr_mac,
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].CceIndex = CCEIndex; pdcch_pdu_rel15,
RA_rnti,
if (ss->searchSpaceType->choice.ue_Specific->dci_Formats==NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) ss,
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].beta_PDCCH_1_0 = 0; coreset,
scc,
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].powerControlOffsetSS=1; bwp,
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].precodingAndBeamforming.numPRGs = 1; ra->beam_id,
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].precodingAndBeamforming.prgSize = 275; aggregation_level,
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].precodingAndBeamforming.digBFInterfaces = 1; CCEIndex);
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].precodingAndBeamforming.PMIdx[0] = 0;
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].precodingAndBeamforming.beamIdx[0] = UE_list->UE_ssb_index[UE_id];
#endif
dci_pdu_rel15_t dci_pdu_rel15; dci_pdu_rel15_t dci_pdu_rel15;
dci_pdu_rel15.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0(pdsch_pdu_rel15->rbSize, dci_pdu_rel15.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0(pdsch_pdu_rel15->rbSize,
pdsch_pdu_rel15->rbStart,dci10_bw); pdsch_pdu_rel15->rbStart,dci10_bw);
......
...@@ -793,9 +793,7 @@ void schedule_fapi_ul_pdu(int Mod_idP, ...@@ -793,9 +793,7 @@ void schedule_fapi_ul_pdu(int Mod_idP,
ss, ss,
coreset, coreset,
scc, scc,
bwp, bwp);
aggregation_level,
CCEIndex);
nr_configure_dci(nr_mac, nr_configure_dci(nr_mac,
pdcch_pdu_rel15, pdcch_pdu_rel15,
UE_info->rnti[UE_id], ss, UE_info->rnti[UE_id], ss,
......
...@@ -627,7 +627,15 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP, ...@@ -627,7 +627,15 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP,
sched_ctrl->search_space, sched_ctrl->search_space,
sched_ctrl->coreset, sched_ctrl->coreset,
scc, scc,
bwp, bwp);
nr_configure_dci(nr_mac,
pdcch_pdu_rel15,
RA_rnti,
ss,
coreset,
scc,
bwp,
ra->beam_id,
sched_ctrl->aggregation_level, sched_ctrl->aggregation_level,
sched_ctrl->cce_index); sched_ctrl->cce_index);
...@@ -675,9 +683,7 @@ void nr_configure_pdcch(gNB_MAC_INST *nr_mac, ...@@ -675,9 +683,7 @@ void nr_configure_pdcch(gNB_MAC_INST *nr_mac,
NR_SearchSpace_t *ss, NR_SearchSpace_t *ss,
NR_ControlResourceSet_t *coreset, NR_ControlResourceSet_t *coreset,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_BWP_Downlink_t *bwp, NR_BWP_Downlink_t *bwp) {
uint8_t aggregation_level,
int CCEIndex) {
if (bwp) { // This is not the InitialBWP if (bwp) { // This is not the InitialBWP
pdcch_pdu->BWPSize = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); pdcch_pdu->BWPSize = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275);
pdcch_pdu->BWPStart = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); pdcch_pdu->BWPStart = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth,275);
......
...@@ -258,9 +258,7 @@ void nr_configure_pdcch(gNB_MAC_INST *nr_mac, ...@@ -258,9 +258,7 @@ void nr_configure_pdcch(gNB_MAC_INST *nr_mac,
NR_SearchSpace_t *ss, NR_SearchSpace_t *ss,
NR_ControlResourceSet_t *coreset, NR_ControlResourceSet_t *coreset,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_BWP_Downlink_t *bwp, NR_BWP_Downlink_t *bwp);
uint8_t aggregation_level,
int CCEIndex);
void fill_dci_pdu_rel15(NR_ServingCellConfigCommon_t *scc, void fill_dci_pdu_rel15(NR_ServingCellConfigCommon_t *scc,
NR_CellGroupConfig_t *secondaryCellGroup, NR_CellGroupConfig_t *secondaryCellGroup,
......
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