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,
uint8_t beam_index = ssb_index_from_prach(module_idP,
frameP,
slotP,
preamble_index, freq_index,
preamble_index,
freq_index,
symbol);
int pr_found=0;
if (preamble_index == ra->preambles.preamble_list[beam_index]) {
......@@ -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];
nfapi_nr_ul_tti_request_t *ul_req = &mac->UL_tti_req[0];
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++) {
NR_RA_t *ra = &cc->ra[i];
if (ra->state == WAIT_Msg3) {
if ((frameP == ra->Msg3_frame) && (slotP == ra->Msg3_slot) ){
ul_req->SFN = ra->Msg3_frame;
......@@ -784,8 +783,6 @@ void nr_generate_Msg2(module_id_t module_idP,
for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) {
NR_RA_t *ra = &cc->ra[i];
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;
long locationAndBandwidth;
......@@ -882,52 +879,32 @@ void nr_generate_Msg2(module_id_t module_idP,
pdsch_pdu_rel15->precodingAndBeamforming.digBFInterfaces = 1;
pdsch_pdu_rel15->precodingAndBeamforming.PMIdx[0] = 0;
pdsch_pdu_rel15->precodingAndBeamforming.beamIdx[0] = ra->beam_id;
#if 1
uint8_t nr_of_candidates, aggregation_level;
find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss);
NR_ControlResourceSet_t *coreset = get_coreset(bwp, ss, 0 /* common */);
int CCEIndex = allocate_nr_CCEs(nr_mac,
bwp,
coreset,
aggregation_level,
0, /* n_RNTI 0: common search space */
0); // m
if (CCEIndex < 0) {
LOG_E(MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti);
return;
}
nr_configure_dci(nr_mac,
pdcch_pdu_rel15,
RA_rnti,
ss,
coreset,
scc, bwp,
scc,
bwp,
ra->beam_id,
aggregation_level,
CCEIndex);
#else
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].RNTI=RA_rnti;
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].ScramblingId = *scc->physCellId;
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;
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].CceIndex = CCEIndex;
if (ss->searchSpaceType->choice.ue_Specific->dci_Formats==NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0)
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].beta_PDCCH_1_0 = 0;
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].powerControlOffsetSS=1;
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].precodingAndBeamforming.numPRGs = 1;
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].precodingAndBeamforming.prgSize = 275;
pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci].precodingAndBeamforming.digBFInterfaces = 1;
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.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0(pdsch_pdu_rel15->rbSize,
pdsch_pdu_rel15->rbStart,dci10_bw);
......
......@@ -793,9 +793,7 @@ void schedule_fapi_ul_pdu(int Mod_idP,
ss,
coreset,
scc,
bwp,
aggregation_level,
CCEIndex);
bwp);
nr_configure_dci(nr_mac,
pdcch_pdu_rel15,
UE_info->rnti[UE_id], ss,
......
......@@ -626,8 +626,16 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP,
rnti,
sched_ctrl->search_space,
sched_ctrl->coreset,
scc,
bwp);
nr_configure_dci(nr_mac,
pdcch_pdu_rel15,
RA_rnti,
ss,
coreset,
scc,
bwp,
ra->beam_id,
sched_ctrl->aggregation_level,
sched_ctrl->cce_index);
......@@ -675,9 +683,7 @@ void nr_configure_pdcch(gNB_MAC_INST *nr_mac,
NR_SearchSpace_t *ss,
NR_ControlResourceSet_t *coreset,
NR_ServingCellConfigCommon_t *scc,
NR_BWP_Downlink_t *bwp,
uint8_t aggregation_level,
int CCEIndex) {
NR_BWP_Downlink_t *bwp) {
if (bwp) { // This is not the InitialBWP
pdcch_pdu->BWPSize = NRRIV2BW(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,
NR_SearchSpace_t *ss,
NR_ControlResourceSet_t *coreset,
NR_ServingCellConfigCommon_t *scc,
NR_BWP_Downlink_t *bwp,
uint8_t aggregation_level,
int CCEIndex);
NR_BWP_Downlink_t *bwp);
void fill_dci_pdu_rel15(NR_ServingCellConfigCommon_t *scc,
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