Merge remote-tracking branch 'origin/develop-nr' into NR_RRCConfiguration
Conflicts: cmake_targets/CMakeLists.txt executables/nr-gnb.c nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h openair1/PHY/INIT/nr_init_ue.c openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c openair1/PHY/NR_UE_TRANSPORT/nr_prach.c openair2/COMMON/rrc_messages_types.h openair2/GNB_APP/gnb_config.c openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c openair2/LAYER2/NR_MAC_gNB/config.c openair2/NR_PHY_INTERFACE/NR_IF_Module.c openair2/RRC/NR/MESSAGES/asn1_msg.c openair2/RRC/NR/nr_rrc_defs.h openair2/RRC/NR/rrc_gNB.c
This commit is contained in:
@@ -52,15 +52,14 @@ extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
|
||||
extern uint8_t nfapi_mode;
|
||||
extern uint16_t sf_ahead;
|
||||
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info)
|
||||
{
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
||||
if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
|
||||
|
||||
AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
|
||||
UL_info->rach_ind.rach_indication_body.number_of_preambles=0;
|
||||
LOG_D(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->slot, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf));
|
||||
/*
|
||||
initiate_ra_proc(UL_info->module_id,
|
||||
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
|
||||
@@ -99,20 +98,19 @@ void handle_nr_sr(NR_UL_IND_t *UL_info) {
|
||||
UL_info->slot,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
UL_info->sr_ind.sr_indication_body.number_of_srs=0;
|
||||
}
|
||||
|
||||
void handle_nr_cqi(NR_UL_IND_t *UL_info) {
|
||||
|
||||
if (nfapi_mode == 1)
|
||||
{
|
||||
if (UL_info->cqi_ind.number_of_cqis>0)
|
||||
{
|
||||
if (nfapi_mode == 1) {
|
||||
if (UL_info->cqi_ind.number_of_cqis>0) {
|
||||
LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis);
|
||||
nfapi_cqi_indication_t ind;
|
||||
|
||||
ind.header.message_id = NFAPI_RX_CQI_INDICATION;
|
||||
ind.sfn_sf = UL_info->frame<<4 | UL_info->slot;
|
||||
ind.cqi_indication_body = UL_info->cqi_ind;
|
||||
@@ -141,15 +139,11 @@ void handle_nr_cqi(NR_UL_IND_t *UL_info) {
|
||||
}
|
||||
|
||||
void handle_nr_harq(NR_UL_IND_t *UL_info) {
|
||||
|
||||
if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) // PNF
|
||||
{
|
||||
if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) { // PNF
|
||||
//LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs);
|
||||
|
||||
/* int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
|
||||
|
||||
if (retval!=0)
|
||||
{
|
||||
if (retval!=0) {
|
||||
LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval);
|
||||
}
|
||||
*/
|
||||
@@ -170,36 +164,32 @@ void handle_nr_harq(NR_UL_IND_t *UL_info) {
|
||||
}
|
||||
|
||||
void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
|
||||
if(nfapi_mode == 1)
|
||||
{
|
||||
if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0)
|
||||
{
|
||||
if(nfapi_mode == 1) {
|
||||
if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
||||
|
||||
// oai_nfapi_crc_indication(&UL_info->crc_ind);
|
||||
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
}
|
||||
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0)
|
||||
{
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0) {
|
||||
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
|
||||
// oai_nfapi_rx_ind(&UL_info->rx_ind);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
for (int i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) {
|
||||
for (int j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) {
|
||||
for (int i=0; i<UL_info->rx_ind.rx_indication_body.number_of_pdus; i++) {
|
||||
for (int j=0; j<UL_info->crc_ind.crc_indication_body.number_of_crcs; j++) {
|
||||
// find crc_indication j corresponding rx_indication i
|
||||
LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
|
||||
LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j,
|
||||
UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
|
||||
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) {
|
||||
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag);
|
||||
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->slot);
|
||||
/*
|
||||
@@ -228,73 +218,65 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
*/
|
||||
}
|
||||
|
||||
break;
|
||||
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
|
||||
// UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti)
|
||||
} // for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++)
|
||||
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
|
||||
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs=0;
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
} // UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->slot && UL_info->crc_ind.crc_indication_body.number_of_crcs>0
|
||||
else if (UL_info->rx_ind.rx_indication_body.number_of_pdus!=0 || UL_info->crc_ind.crc_indication_body.number_of_crcs!=0) {
|
||||
LOG_E(PHY,"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SF:%05d) crc_ind:%d(SFN/SF:%05d) UL_info(SFN/SF):%04d%d\n",
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf),
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf),
|
||||
UL_info->frame, UL_info->slot);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf),
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf),
|
||||
UL_info->frame, UL_info->slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NR_UL_indication(NR_UL_IND_t *UL_info)
|
||||
{
|
||||
void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
|
||||
|
||||
#ifdef DUMP_FAPI
|
||||
dump_ul(UL_info);
|
||||
#endif
|
||||
|
||||
module_id_t module_id = UL_info->module_id;
|
||||
int CC_id = UL_info->CC_id;
|
||||
NR_Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id];
|
||||
NR_IF_Module_t *ifi = if_inst[module_id];
|
||||
gNB_MAC_INST *mac = RC.nrmac[module_id];
|
||||
|
||||
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
|
||||
UL_info->frame,UL_info->slot,
|
||||
module_id,CC_id,
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis,
|
||||
UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
|
||||
|
||||
if (nfapi_mode != 1)
|
||||
{
|
||||
if (nfapi_mode != 1) {
|
||||
if (ifi->CC_mask==0) {
|
||||
ifi->current_frame = UL_info->frame;
|
||||
ifi->current_slot = UL_info->slot;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask);
|
||||
AssertFatal(UL_info->slot != ifi->current_slot,"CC_mask %x is not full and slot has changed\n",ifi->CC_mask);
|
||||
}
|
||||
|
||||
ifi->CC_mask |= (1<<CC_id);
|
||||
}
|
||||
|
||||
// clear DL/UL info for new scheduling round
|
||||
clear_nr_nfapi_information(mac,CC_id,UL_info->frame,UL_info->slot);
|
||||
|
||||
handle_nr_rach(UL_info);
|
||||
|
||||
handle_nr_sr(UL_info);
|
||||
|
||||
handle_nr_cqi(UL_info);
|
||||
|
||||
handle_nr_harq(UL_info);
|
||||
|
||||
// clear HI prior to handling ULSCH
|
||||
mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0;
|
||||
|
||||
handle_nr_ulsch(UL_info);
|
||||
|
||||
if (nfapi_mode != 1)
|
||||
{
|
||||
if (nfapi_mode != 1) {
|
||||
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
|
||||
/*
|
||||
eNB_dlsch_ulsch_scheduler(module_id,
|
||||
@@ -302,20 +284,18 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
|
||||
(UL_info->slot+sf_ahead)%10);
|
||||
*/
|
||||
nfapi_nr_config_request_t *cfg = &mac->config[CC_id];
|
||||
int spf = get_spf(cfg);
|
||||
|
||||
int spf = get_spf(cfg);
|
||||
gNB_dlsch_ulsch_scheduler(module_id,
|
||||
(UL_info->frame+((UL_info->slot>(spf-1-sf_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+sf_ahead)%spf);
|
||||
|
||||
(UL_info->frame+((UL_info->slot>(spf-1-sf_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+sf_ahead)%spf);
|
||||
ifi->CC_mask = 0;
|
||||
|
||||
sched_info->module_id = module_id;
|
||||
sched_info->CC_id = CC_id;
|
||||
sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-sf_ahead)) ? 1 : 0)) % 1024;
|
||||
sched_info->slot = (UL_info->slot+sf_ahead)%spf;
|
||||
sched_info->DL_req = &mac->DL_req[CC_id];
|
||||
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
|
||||
|
||||
if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
|
||||
(is_nr_UL_slot(&mac->common_channels[CC_id],(sched_info->slot+sf_ahead)%spf)>0))
|
||||
sched_info->UL_req = &mac->UL_req[CC_id];
|
||||
@@ -323,13 +303,11 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
|
||||
sched_info->UL_req = NULL;
|
||||
|
||||
sched_info->TX_req = &mac->TX_req[CC_id];
|
||||
|
||||
#ifdef DUMP_FAPI
|
||||
dump_dl(sched_info);
|
||||
#endif
|
||||
|
||||
if (ifi->NR_Schedule_response)
|
||||
{
|
||||
if (ifi->NR_Schedule_response) {
|
||||
AssertFatal(ifi->NR_Schedule_response!=NULL,
|
||||
"nr_schedule_response is null (mod %d, cc %d)\n",
|
||||
module_id,
|
||||
@@ -342,15 +320,11 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
|
||||
}
|
||||
}
|
||||
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id)
|
||||
{
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {
|
||||
AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
|
||||
|
||||
LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n");
|
||||
|
||||
if (if_inst[Mod_id]==NULL) {
|
||||
|
||||
|
||||
if_inst[Mod_id] = (NR_IF_Module_t*)malloc(sizeof(NR_IF_Module_t));
|
||||
memset((void*)if_inst[Mod_id],0,sizeof(NR_IF_Module_t));
|
||||
|
||||
@@ -358,9 +332,9 @@ NR_IF_Module_t *NR_IF_Module_init(int Mod_id)
|
||||
|
||||
if_inst[Mod_id]->CC_mask=0;
|
||||
if_inst[Mod_id]->NR_UL_indication = NR_UL_indication;
|
||||
|
||||
AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0,
|
||||
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
|
||||
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
|
||||
}
|
||||
|
||||
return if_inst[Mod_id];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user