Commit f629b77e authored by matzakos's avatar matzakos

nr-ip-over-LTE: Add checks for noS1 use case (nr-UE side)

parent ec627f7c
...@@ -989,7 +989,8 @@ int main( int argc, char **argv ) ...@@ -989,7 +989,8 @@ int main( int argc, char **argv )
flexran_agent_start(i); flexran_agent_start(i);
} }
init_pdcp(); if(IS_SOFTMODEM_NOS1)
init_pdcp();
// init UE_PF_PO and mutex lock // init UE_PF_PO and mutex lock
pthread_mutex_init(&ue_pf_po_mutex, NULL); pthread_mutex_init(&ue_pf_po_mutex, NULL);
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "common/utils/system.h" #include "common/utils/system.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "executables/nr-softmodem.h"
#include "T.h" #include "T.h"
...@@ -383,12 +384,14 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { ...@@ -383,12 +384,14 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
#endif #endif
} }
//Hardcoded rnti value if(IS_SOFTMODEM_NOS1){
protocol_ctxt_t ctxt; //Hardcoded rnti value
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO, protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO,
0x1234, proc->frame_rx, 0x1234, proc->frame_rx,
proc->nr_tti_rx, 0); proc->nr_tti_rx, 0);
pdcp_run(&ctxt); pdcp_run(&ctxt);
}
// no UL for now // no UL for now
/* /*
if (UE->mac_enabled==1) { if (UE->mac_enabled==1) {
......
...@@ -681,10 +681,11 @@ void init_pdcp(void) { ...@@ -681,10 +681,11 @@ void init_pdcp(void) {
if (IS_SOFTMODEM_NOKRNMOD) if (IS_SOFTMODEM_NOKRNMOD)
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; 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"); LOG_I(RLC, "Problem at RLC initiation \n");
} }
pdcp_layer_init(); pdcp_layer_init();
nr_ip_over_LTE_DRB_preconfiguration();*/
pdcp_module_init(pdcp_initmask); pdcp_module_init(pdcp_initmask);
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); 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); pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
...@@ -727,8 +728,8 @@ int main( int argc, char **argv ) { ...@@ -727,8 +728,8 @@ int main( int argc, char **argv ) {
if (init_opt() == -1) if (init_opt() == -1)
LOG_E(OPT,"failed to run OPT \n"); LOG_E(OPT,"failed to run OPT \n");
} }
//Add --nr-ip-over-lte option check here if(IS_SOFTMODEM_NOS1)
init_pdcp(); init_pdcp();
/* /*
#ifdef PDCP_USE_NETLINK #ifdef PDCP_USE_NETLINK
......
...@@ -663,6 +663,10 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -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]); printf("%d : %d \n", i, harq_process->b[i]);
}*/ }*/
#endif #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]);
}*/
} }
......
...@@ -3810,6 +3810,7 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -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].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 = dlsch0->harq_processes[harq_pid]->b;
rx_ind.rx_indication_body[0].pdsch_pdu.pdu_length = dlsch0->harq_processes[harq_pid]->TBS>>3; 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; rx_ind.number_pdus = 1;
//ue->dl_indication.rx_ind = &dlsch1->harq_processes[harq_pid]->b; //no data, only dci for now //ue->dl_indication.rx_ind = &dlsch1->harq_processes[harq_pid]->b; //no data, only dci for now
......
...@@ -134,5 +134,7 @@ void nr_ue_process_mac_pdu( ...@@ -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); 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 #endif
/** @}*/ /** @}*/
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
//#include "defs.h" //#include "defs.h"
#include "mac_proto.h" #include "mac_proto.h"
#include "executables/nr-softmodem.h"
static NR_UE_MAC_INST_t *nr_ue_mac_inst; static NR_UE_MAC_INST_t *nr_ue_mac_inst;
...@@ -45,6 +46,14 @@ nr_l2_init_ue(void) ...@@ -45,6 +46,14 @@ nr_l2_init_ue(void)
//init mac here //init mac here
nr_ue_mac_inst = (NR_UE_MAC_INST_t *)malloc(sizeof(NR_UE_MAC_INST_t)*NB_NR_UE_MAC_INST); 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); return (1);
} }
......
...@@ -332,7 +332,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -332,7 +332,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
frameP, frameP,
slotP, slotP,
*cfg)){ *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); nr_schedule_uss_dlsch_phytest(module_idP, frameP, slotP);
} }
......
...@@ -2183,7 +2183,8 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) { ...@@ -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; int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 )?MAX_NUMBER_NETIF:1;
netlink_init_tun("ue",num_if); netlink_init_tun("ue",num_if);
//Add --nr-ip-over-lte option check for next line //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"); LOG_I(PDCP, "UE pdcp will use tun interface\n");
} else if(ENB_NAS_USE_TUN) { } else if(ENB_NAS_USE_TUN) {
netlink_init_tun("enb",1); netlink_init_tun("enb",1);
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "assertions.h" #include "assertions.h"
#include "LAYER2/NR_MAC_UE/mac_extern.h" #include "LAYER2/NR_MAC_UE/mac_extern.h"
#include "SCHED_NR_UE/fapi_nr_ue_l1.h" #include "SCHED_NR_UE/fapi_nr_ue_l1.h"
#include "executables/nr-softmodem.h"
#include <stdio.h> #include <stdio.h>
...@@ -73,7 +74,8 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, fapi_nr ...@@ -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){ 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"); 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, pduP,
pdu_len, pdu_len,
0); 0);
......
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