diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index fbcf3bed29..fe7cf8f0ab 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -989,7 +989,8 @@ int main( int argc, char **argv ) flexran_agent_start(i); } - init_pdcp(); + if(IS_SOFTMODEM_NOS1) + init_pdcp(); // init UE_PF_PO and mutex lock pthread_mutex_init(&ue_pf_po_mutex, NULL); diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 40b2e0a975..3c8cd4bcf3 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -45,6 +45,7 @@ #include "common/utils/LOG/log.h" #include "common/utils/system.h" #include "common/utils/LOG/vcd_signal_dumper.h" +#include "executables/nr-softmodem.h" #include "T.h" @@ -383,12 +384,14 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { #endif } - //Hardcoded rnti value - protocol_ctxt_t ctxt; - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO, + if(IS_SOFTMODEM_NOS1){ + //Hardcoded rnti value + protocol_ctxt_t ctxt; + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO, 0x1234, proc->frame_rx, proc->nr_tti_rx, 0); - pdcp_run(&ctxt); + pdcp_run(&ctxt); + } // no UL for now /* if (UE->mac_enabled==1) { diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 45236399e1..7da3b626c9 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -681,10 +681,11 @@ void init_pdcp(void) { if (IS_SOFTMODEM_NOKRNMOD) pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; - if (rlc_module_init() != 0) { + /*if (rlc_module_init() != 0) { LOG_I(RLC, "Problem at RLC initiation \n"); } pdcp_layer_init(); + nr_ip_over_LTE_DRB_preconfiguration();*/ pdcp_module_init(pdcp_initmask); pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind); @@ -727,8 +728,8 @@ int main( int argc, char **argv ) { if (init_opt() == -1) LOG_E(OPT,"failed to run OPT \n"); } - //Add --nr-ip-over-lte option check here - init_pdcp(); + if(IS_SOFTMODEM_NOS1) + init_pdcp(); /* #ifdef PDCP_USE_NETLINK diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 6ba2091c56..995c6f724c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -663,6 +663,10 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, printf("%d : %d \n", i, harq_process->b[i]); }*/ #endif + /*LOG_I (PHY, "Printing 100 first payload bytes:"); + for (int i = 0; i <100 ; i++){ //Kr_bytes + LOG_I(PHY, "[%d] : %x ", i, harq_process->b[i]); + }*/ } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 784c714aa1..56e25073cb 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -3810,6 +3810,7 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, rx_ind.rx_indication_body[0].pdu_type = FAPI_NR_RX_PDU_TYPE_DLSCH; rx_ind.rx_indication_body[0].pdsch_pdu.pdu = dlsch0->harq_processes[harq_pid]->b; rx_ind.rx_indication_body[0].pdsch_pdu.pdu_length = dlsch0->harq_processes[harq_pid]->TBS>>3; + LOG_D(PHY, "PDU length in bits: %d, in bytes: %d \n", dlsch0->harq_processes[harq_pid]->TBS, rx_ind.rx_indication_body[0].pdsch_pdu.pdu_length); rx_ind.number_pdus = 1; //ue->dl_indication.rx_ind = &dlsch1->harq_processes[harq_pid]->b; //no data, only dci for now diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 80503cb93e..98389ddcfd 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -134,5 +134,7 @@ void nr_ue_process_mac_pdu( int8_t nr_ue_process_dlsch(module_id_t module_id, int cc_id, uint8_t gNB_index, fapi_nr_dci_indication_t *dci_ind, void *pduP, uint32_t pdu_len); +void nr_ue_send_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_frame_t subframeP, uint8_t * sdu, uint16_t sdu_len, uint8_t eNB_index); + #endif /** @}*/ diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index 3688514745..c96acccf9b 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -32,6 +32,7 @@ //#include "defs.h" #include "mac_proto.h" +#include "executables/nr-softmodem.h" static NR_UE_MAC_INST_t *nr_ue_mac_inst; @@ -45,6 +46,14 @@ nr_l2_init_ue(void) //init mac here nr_ue_mac_inst = (NR_UE_MAC_INST_t *)malloc(sizeof(NR_UE_MAC_INST_t)*NB_NR_UE_MAC_INST); + if (IS_SOFTMODEM_NOS1){ + if (rlc_module_init() != 0) { + LOG_I(RLC, "Problem at RLC initiation \n"); + } + pdcp_layer_init(); + nr_ip_over_LTE_DRB_preconfiguration(); + } + return (1); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 9ac139cfd5..635220b6e9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -332,7 +332,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frameP, slotP, *cfg)){ - LOG_I(MAC, "About to call nr_schedule_uss_dlsch_phytest() because there is a dci opportunity... \n \n \n"); nr_schedule_uss_dlsch_phytest(module_idP, frameP, slotP); } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 018ed8f0cb..7f87b032a2 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -2183,7 +2183,8 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) { int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 )?MAX_NUMBER_NETIF:1; netlink_init_tun("ue",num_if); //Add --nr-ip-over-lte option check for next line - nas_config(1, 1, 2, "ue"); + if (IS_SOFTMODEM_NOS1) + nas_config(1, 1, 2, "ue"); LOG_I(PDCP, "UE pdcp will use tun interface\n"); } else if(ENB_NAS_USE_TUN) { netlink_init_tun("enb",1); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 3c0a672866..346727cb29 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -35,6 +35,7 @@ #include "assertions.h" #include "LAYER2/NR_MAC_UE/mac_extern.h" #include "SCHED_NR_UE/fapi_nr_ue_l1.h" +#include "executables/nr-softmodem.h" #include @@ -73,7 +74,8 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, fapi_nr int8_t handle_dlsch (module_id_t module_id, int cc_id, uint8_t gNB_index, fapi_nr_dci_indication_t *dci_ind, uint8_t *pduP, uint32_t pdu_len, frame_t frame, int slot){ LOG_I(MAC, "handle_dlsch at MAC layer \n"); - nr_ue_send_sdu(module_id, 0, frame, slot, + if (IS_SOFTMODEM_NOS1) + nr_ue_send_sdu(module_id, 0, frame, slot, pduP, pdu_len, 0);