From 2cd848908646746dc8d76fabc5872ed16e3b0428 Mon Sep 17 00:00:00 2001 From: Sandeep Kumar Date: Mon, 13 Jun 2016 18:50:05 +0200 Subject: [PATCH] starting to add run options for node_function --- openair1/SCHED/phy_procedures_lte_eNb.c | 32 ++++----- targets/RT/USER/lte-softmodem.c | 92 ++++++++++++++++++++----- 2 files changed, 92 insertions(+), 32 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 785001e8f4..0e1685d266 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2498,7 +2498,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl eNB_proc_t *proc = &eNB->proc; int subframe = proc->subframe_rx; int frame = proc->frame_rx; - int symbol_number, symbol_mask, symbol_mask_full, prach_rx; + int symbol_number, symbol_mask, symbol_mask_full, prach_rx, packet_type; if (subframe==9) { subframe=0; @@ -2580,23 +2580,23 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl // get frame/subframe information from IF4 interface // timed loop (200 us) - symbol_mask = 0; - symbol_mask_full = (1<symbols_per_tti)-1; - if (is_prach_subframe(fp,frame,subframe)>0) - prach_rx = 0; - else - prach_rx = 1; + //symbol_mask = 0; + //symbol_mask_full = (1<symbols_per_tti)-1; + //if (is_prach_subframe(fp,frame,subframe)>0) + //prach_rx = 0; + //else + //prach_rx = 1; - do { - recv_IF4(eNB, proc, &packet_type, &symbol_number); - if (is_prach_subframe(fp,frame,subframe)>0 && packet_type == PRACH) { - // wake up prach_rx - prach_rx = 1; - } - if (packet_type == PULFFT) - symbol_mask = symbol_mask | (1<0 && packet_type == PRACH) { + //// wake up prach_rx + //prach_rx = 1; + //} + //if (packet_type == IF4_PULFFT) + //symbol_mask = symbol_mask | (1<properties[i]->rrh_gw_config[j].active == 1 ) { local_remote_radio = BBU_REMOTE_RADIO_HEAD; - eth_params = (eth_params_t*)malloc(sizeof(eth_params_t)); + eth_params = (eth_params_t*)malloc(sizeof(eth_params_t)); memset(eth_params, 0, sizeof(eth_params_t)); eth_params->local_if_name = enb_properties->properties[i]->rrh_gw_if_name; @@ -1120,7 +1141,6 @@ int main( int argc, char **argv ) uint16_t Nid_cell = 0; uint8_t cooperation_flag=0, abstraction_flag=0; uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2; - eNB_func_t node_function=eNodeB_3GPP; #if defined (XFORMS) int ret; @@ -1458,13 +1478,20 @@ int main( int argc, char **argv ) else //FDD openair0_cfg[card].duplex_mode = duplex_mode_FDD; - + if (local_remote_radio == BBU_REMOTE_RADIO_HEAD) { openair0_cfg[card].remote_addr = eth_params->remote_addr; openair0_cfg[card].remote_port = eth_params->remote_port; openair0_cfg[card].my_addr = eth_params->my_addr; openair0_cfg[card].my_port = eth_params->my_port; - } + } + + //if (node_function == NGFI_RCC_IF4 || node_function == NGFI_RRU_IF4) { + //openair0_cfg[card].remote_addr = eth_params->remote_addr; + //openair0_cfg[card].remote_port = eth_params->remote_port; + //openair0_cfg[card].my_addr = eth_params->my_addr; + //openair0_cfg[card].my_port = eth_params->my_port; + //} printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card, ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx), @@ -1562,35 +1589,68 @@ int main( int argc, char **argv ) /* transport type is initialized NONE_TP (no transport protocol) when the transport protocol will be initiated transport protocol type will be set */ openair0.transp_type = NONE_TP; openair0_cfg[0].log_level = glog_level; - + + // Legacy BBU - RRH init + //int returns=-1; + ///* BBU can have either a local or a remote radio head */ + //if (local_remote_radio == BBU_LOCAL_RADIO_HEAD) { //local radio head active - load library of radio head and initiate it + //if (mode!=loop_through_memory) { + //returns=openair0_device_load(&openair0, &openair0_cfg[0]); + //printf("openair0_device_init returns %d\n",returns); + //if (returns<0) { + //printf("Exiting, cannot initialize device\n"); + //exit(-1); + //} + //} + //else if (mode==loop_through_memory) { + //} + //} else { //remote radio head active - load library of transport protocol and initiate it + //if (mode!=loop_through_memory) { + //returns=openair0_transport_load(&openair0, &openair0_cfg[0], eth_params); + //printf("openair0_transport_init returns %d\n",returns); + //if (returns<0) { + //printf("Exiting, cannot initialize transport protocol\n"); + //exit(-1); + //} + //} + //else if (mode==loop_through_memory) { + //} + //} + + //printf("Done\n"); + int returns=-1; - /* BBU can have either a local or a remote radio head */ - if (local_remote_radio == BBU_LOCAL_RADIO_HEAD) { //local radio head active - load library of radio head and initiate it + + // Load RF device and initialize + if (node_function == eNodeB_3GPP || node_function == NGFI_RRU_IF4) { if (mode!=loop_through_memory) { returns=openair0_device_load(&openair0, &openair0_cfg[0]); printf("openair0_device_init returns %d\n",returns); if (returns<0) { - printf("Exiting, cannot initialize device\n"); - exit(-1); + printf("Exiting, cannot initialize device\n"); + exit(-1); } } else if (mode==loop_through_memory) { } - } else { //remote radio head active - load library of transport protocol and initiate it + } + + // Load transport protocol and initialize + if (node_function == NGFI_RCC_IF4 || node_function == NGFI_RRU_IF4){ if (mode!=loop_through_memory) { returns=openair0_transport_load(&openair0, &openair0_cfg[0], eth_params); printf("openair0_transport_init returns %d\n",returns); if (returns<0) { - printf("Exiting, cannot initialize transport protocol\n"); - exit(-1); + printf("Exiting, cannot initialize transport protocol\n"); + exit(-1); } } else if (mode==loop_through_memory) { } } - - printf("Done\n"); + printf("Done\n"); + mac_xface = malloc(sizeof(MAC_xface)); int eMBMS_active=0;