Commit 42ae8207 authored by Melissa Elkadi's avatar Melissa Elkadi

NFAPI_MODE logic to include standalone mode

Every if statement that includes a check for
the NFAPI_MODE that did not check for the new
PNF_STANDALONE_MODE now has been updated. Also
changed the tx_req and dl_config_req logs
when they are received at the OAI UE to be
info logs instead of error logs.
parent 3108258b
......@@ -485,7 +485,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
// to keep only the necessary just to keep the nfapi FSM rolling by sending a dummy response.
LTE_DL_FRAME_PARMS *fp;
if (NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
if (NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
fp = &eNB->frame_parms;
} else {
......@@ -647,7 +647,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
num_tlv++;
}
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
printf("[PNF] CONFIG_REQUEST[num_tlv:%d] TLVs processed:%d\n", req->num_tlv, num_tlv);
printf("[PNF] Simulating PHY CONFIG - DJP\n");
PHY_Config_t phy_config;
......@@ -672,7 +672,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
nfapi_pnf_config_resp(config, &nfapi_resp);
printf("[PNF] Sent NFAPI_CONFIG_RESPONSE phy_id:%d\n", phy_info->id);
if(NFAPI_MODE==NFAPI_UE_STUB_PNF)
if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF)
free(fp);
return 0;
......@@ -1035,7 +1035,7 @@ int start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
p7_config->tx_req = &pnf_phy_tx_req;
p7_config->lbt_dl_config_req = &pnf_phy_lbt_dl_config_req;
p7_config->ue_release_req = &pnf_phy_ue_release_req;
if (NFAPI_MODE==NFAPI_UE_STUB_PNF) {
if (NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) {
p7_config->dl_config_req = &memcpy_dl_config_req;
p7_config->ul_config_req = &memcpy_ul_config_req;
p7_config->hi_dci0_req = &memcpy_hi_dci0_req;
......@@ -1092,7 +1092,7 @@ int start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
//phy_init_RU(RC.ru[0]);
printf("[PNF] About to call init_eNB_afterRU()\n");
if (NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
if (NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
init_eNB_afterRU();
}
......@@ -1376,7 +1376,7 @@ void *pnf_start_thread(void *ptr) {
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {
printf("%s() PNF\n\n\n\n\n\n", __FUNCTION__);
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
nfapi_setmode(NFAPI_MODE_PNF); // PNF!
}
......
......@@ -547,7 +547,7 @@ void phy_config_dedicated_ue(module_id_t Mod_id,int CC_id,uint8_t eNB_id,
phy_vars_ue->decode_MIB = 0;
}
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
//phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234)
phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti;
......
......@@ -115,7 +115,7 @@ void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_
}
int8_t get_PHR(uint8_t Mod_id, uint8_t CC_id,uint8_t eNB_index) {
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF)
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF)
return PHY_vars_UE_g[Mod_id][CC_id]->ulsch[eNB_index]->PHR;
else
return 40; // l1l2 simulator => ideal conditions
......
......@@ -203,7 +203,7 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
LTE_MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
}
if(NFAPI_MODE != NFAPI_UE_STUB_PNF)
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF)
phy_config_harq_ue(Mod_idP, 0, eNB_index, UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx);
if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) {
......@@ -311,7 +311,7 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
}
if (physicalConfigDedicated != NULL) {
if(NFAPI_MODE != NFAPI_UE_STUB_PNF)
if(NFAPI_MODE != NFAPI_UE_STUB_PNF && NFAPI_MODE != NFAPI_MODE_STANDALONE_PNF)
phy_config_dedicated_ue(Mod_idP, 0, eNB_index,
physicalConfigDedicated);
......
......@@ -91,7 +91,7 @@ mac_top_init_ue(int eMBMS_active, char *uecap_xer,
}
// mutex below are used for multiple UE's L2 FAPI simulation.
if (NFAPI_MODE == NFAPI_UE_STUB_PNF) {
if (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) {
pthread_mutex_init(&fill_ul_mutex.rx_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.crc_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.sr_mutex,NULL);
......
......@@ -998,7 +998,7 @@ pdcp_data_ind(
* for the UE compiled in noS1 mode, we need 0
* TODO: be sure of this
*/
if (NFAPI_MODE == NFAPI_UE_STUB_PNF ) {
if (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) {
#ifdef UESIM_EXPANSION
if (UE_NAS_USE_TUN) {
......@@ -2295,7 +2295,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
nas_getparams();
if(UE_NAS_USE_TUN) {
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 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?MAX_NUMBER_NETIF:1;
netlink_init_tun("ue",num_if);
if (IS_SOFTMODEM_NOS1)
nas_config(1, 1, 2, "ue");
......
......@@ -512,7 +512,7 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
}
}
} else { // ctxt.enb_flag => UE
if (NFAPI_MODE == NFAPI_UE_STUB_PNF) {
if (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) {
#ifdef UESIM_EXPANSION
ctxt.module_id = inst_pdcp_list[pdcp_read_header_g.inst];
#else
......@@ -568,8 +568,8 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
pdcp_read_header_g.data_size,
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
PDCP_TRANSMISSION_MODE_DATA,
(NFAPI_MODE == NFAPI_UE_STUB_PNF)?NULL:&pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF)?NULL:&pdcp_read_header_g.destinationL2Id
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?NULL:&pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?NULL:&pdcp_read_header_g.destinationL2Id
);
} else { /* else of h_rc == HASH_TABLE_OK */
MSC_LOG_RX_DISCARDED_MESSAGE(
......@@ -613,8 +613,8 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
pdcp_read_header_g.data_size,
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
PDCP_TRANSMISSION_MODE_DATA,
(NFAPI_MODE == NFAPI_UE_STUB_PNF) ? NULL :&pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF) ? NULL :&pdcp_read_header_g.destinationL2Id
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL :&pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL :&pdcp_read_header_g.destinationL2Id
);
} /* rab_id == 0 */
} /*pdcp_read_state_g != 0 */
......
......@@ -1510,8 +1510,8 @@ void enqueue_dl_config_req_tx_req(nfapi_dl_config_request_t *dl_config_req, nfap
nfapi_dl_config_request_t *dl_config_req_temp = memcpy_dl_config_req_standalone(dl_config_req);
nfapi_tx_req_pdu_list_t *tx_req_temp = memcpy_tx_req_standalone(tx_req);
LOG_E(MAC, "This is the num_pdus for tx_req: %d\n", tx_req_temp->num_pdus);
LOG_E(MAC, "This is the num_pdus for dl_config_req and the sfn_sf: %d, %d:%d\n", dl_config_req_temp->dl_config_request_body.number_pdu,
LOG_I(MAC, "This is the num_pdus for tx_req: %d\n", tx_req_temp->num_pdus);
LOG_I(MAC, "This is the num_pdus for dl_config_req and the sfn_sf: %d, %d:%d\n", dl_config_req_temp->dl_config_request_body.number_pdu,
NFAPI_SFNSF2SFN(dl_config_req_temp->sfn_sf), NFAPI_SFNSF2SF(dl_config_req_temp->sfn_sf));
nfapi_dl_config_req_tx_req_t *req = malloc(sizeof(nfapi_dl_config_req_tx_req_t));
......
......@@ -267,7 +267,7 @@ int esm_ebr_context_create(
strcpy(broadcast, ipv4_addr);
}
if(NFAPI_MODE==NFAPI_UE_STUB_PNF) {
if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) {
// this is for L2 FAPI simulator.
// change for multiple UE's like 256UEs.
// if it's made too many tables , OS may crush so we use one table.
......
......@@ -193,7 +193,7 @@ PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
ue->mac_enabled = 1;
// In phy_stub_UE (MAC-to-MAC) mode these init functions don't need to get called. Is this correct?
if (NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
if (NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
// initialize all signal buffers
init_lte_ue_signal(ue,1,abstraction_flag);
// intialize transport
......@@ -466,7 +466,7 @@ void init_UE_stub(int nb_inst,
printf("UE threads created \n");
LOG_I(PHY,"Starting multicast link on %s\n",emul_iface);
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF)
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF)
multicast_link_start(ue_stub_rx_handler,0,emul_iface);
}
......@@ -2399,7 +2399,7 @@ void init_UE_single_thread_stub(int nb_inst)
AssertFatal(PHY_vars_UE_g[i]!=NULL,"PHY_vars_UE_g[inst] is NULL\n");
AssertFatal(PHY_vars_UE_g[i][0]!=NULL,"PHY_vars_UE_g[inst][0] is NULL\n");
if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE_STANDALONE_PNF) {
if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) {
#ifdef NAS_UE
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, INITIALIZE_MESSAGE);
......
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