Commit 34ff17c3 authored by lfarizav's avatar lfarizav

ping working for multiple RRUs from UE and EPC

parent 9c120ed2
......@@ -1109,8 +1109,8 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
printf("UE %d, thread %d = %d\n",ue->Mod_id,i,ue->current_thread_id[i]);
}
printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+1/*NB_eNB_INST*/);
printf("[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+1/*NB_eNB_INST*/);
// many memory allocation sizes are hard coded
AssertFatal( fp->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]");
AssertFatal( ue->n_connected_eNB <= NUMBER_OF_CONNECTED_eNB_MAX, "n_connected_eNB is too large" );
......
......@@ -363,7 +363,7 @@ ue_send_sdu(
#ifdef DEBUG_HEADER_PARSING
LOG_D(MAC,"[UE %d] ue_send_sdu : Frame %d eNB_index %d : num_ce %d num_sdu %d\n",module_idP,
frameP,/*eNB_index*/PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id,num_ce,num_sdu);
frameP,eNB_index/*PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id*/,num_ce,num_sdu);
#endif
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
......@@ -375,7 +375,13 @@ ue_send_sdu(
LOG_T(MAC,"\n");
#endif
printf("[UE %d] First 32 bytes of DLSCH : \n", module_idP);
for (i=0; i<32; i++) {
printf("%x.",sdu[i]);
}
printf("\n");
if (payload_ptr != NULL) {
for (i=0; i<num_ce; i++) {
......@@ -439,7 +445,7 @@ ue_send_sdu(
module_idP,
UE_mac_inst[module_idP].crnti,
frameP,
/*eNB_index*/PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id,
eNB_index/*PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id*/,
rx_lengths[i]);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
......@@ -465,7 +471,7 @@ ue_send_sdu(
//printf("1\n");
} else if ((rx_lcids[i] == DCCH) || (rx_lcids[i] == DCCH1)) {
LOG_D(MAC,"[UE %d] Frame %d : DLSCH -> DL-DCCH%d, RRC message (eNB %d, %d bytes)\n", module_idP, frameP, rx_lcids[i],/*eNB_index*/PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id,rx_lengths[i]);
LOG_D(MAC,"[UE %d] Frame %d : DLSCH -> DL-DCCH%d, RRC message (eNB %d, %d bytes)\n", module_idP, frameP, rx_lcids[i],eNB_index/*PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id*/,rx_lengths[i]);
mac_rlc_data_ind(module_idP,
UE_mac_inst[module_idP].crnti,
eNB_index/*PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id*/,//changed
......@@ -480,7 +486,7 @@ ue_send_sdu(
} else if ((rx_lcids[i] < NB_RB_MAX) && (rx_lcids[i] > DCCH1 )) {
LOG_D(MAC,"[UE %d] Frame %d : DLSCH -> DL-DTCH%d (eNB %d, %d bytes)\n", module_idP, frameP,rx_lcids[i], /*eNB_index*/PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id,rx_lengths[i]);
LOG_D(MAC,"[UE %d] Frame %d : DLSCH -> DL-DTCH%d (eNB %d, %d bytes)\n", module_idP, frameP,rx_lcids[i], eNB_index/*PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id*/,rx_lengths[i]);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
int j;
......@@ -500,7 +506,7 @@ ue_send_sdu(
1,
NULL);
} else {
LOG_E(MAC,"[UE %d] Frame %d : unknown LCID %d (eNB %d)\n", module_idP, frameP,rx_lcids[i], /*eNB_index*/PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id);
LOG_E(MAC,"[UE %d] Frame %d : unknown LCID %d (eNB %d)\n", module_idP, frameP,rx_lcids[i], eNB_index/*PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id*/);
}
payload_ptr+= rx_lengths[i];
}
......
......@@ -815,7 +815,8 @@ pdcp_data_ind(
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id;
#if defined(OAI_EMU)
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id + oai_emulation.info.nb_enb_local - oai_emulation.info.first_ue_local;
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id + 1/*oai_emulation.info.nb_enb_local*/ - oai_emulation.info.first_ue_local;
printf("pdcp_data_ind: inst %d, ctxt_pP->module_id %d, oai_emulation.info.nb_enb_local %d, oai_emulation.info.first_ue_local %d\n",ctxt_pP->module_id + oai_emulation.info.nb_enb_local - oai_emulation.info.first_ue_local,ctxt_pP->module_id , oai_emulation.info.nb_enb_local , oai_emulation.info.first_ue_local);
#else
# if defined(ENABLE_USE_MME)
/* for the UE compiled in S1 mode, we need 1 here
......
......@@ -247,6 +247,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE_PDCP_FLUSH_SIZE, pdcp_output_sdu_bytes_to_write);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_FLUSH_BUFFER, 1 );
ret = sendmsg(nas_sock_fd,&nas_msg_tx,0);
//printf("[PDCP_FIFOS] sendmsg: socket %d\n",nas_sock_fd);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_FLUSH_BUFFER, 0 );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE_PDCP_FLUSH_ERR, ret );
......@@ -548,12 +549,12 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %zu\n",
nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr));
#endif
printf("[PDCP][NETLINK] Something in socket, length %zu\n",
nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr));
printf("[PDCP][NETLINK] Something in socket, length %zu, ctxt.module_id %d\n",
nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr),ctxt.module_id);
#ifdef OAI_EMU
// overwrite function input parameters, because only one netlink socket for all instances
if (pdcp_read_header_g.inst < oai_emulation.info.nb_enb_local) {
if (pdcp_read_header_g.inst < 1/*oai_emulation.info.nb_enb_local*/) {
ctxt.frame = ctxt_cpy.frame;
ctxt.enb_flag = ENB_FLAG_YES;
ctxt.module_id = pdcp_read_header_g.inst + oai_emulation.info.first_enb_local;
......@@ -562,7 +563,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
} else {
ctxt.frame = ctxt_cpy.frame;
ctxt.enb_flag = ENB_FLAG_NO;
ctxt.module_id = pdcp_read_header_g.inst - oai_emulation.info.nb_enb_local + oai_emulation.info.first_ue_local;
ctxt.module_id = pdcp_read_header_g.inst - 1/*oai_emulation.info.nb_enb_local*/ + oai_emulation.info.first_ue_local;
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
rab_id = pdcp_read_header_g.rb_id % maxDRB;
}
......
......@@ -102,7 +102,7 @@ pdcp_netlink_init(
reset_meas(&ip_pdcp_stats_tmp);
#if defined(USER_MODE) && defined(OAI_EMU)
nb_inst_enb = oai_emulation.info.nb_enb_local;
nb_inst_enb = 1/*oai_emulation.info.nb_enb_local*/;
nb_inst_ue = oai_emulation.info.nb_ue_local;
#else
nb_inst_enb = 1;
......@@ -263,9 +263,9 @@ void *pdcp_netlink_thread_fct(void *arg)
#ifdef OAI_EMU
// LG: new_data_p->pdcp_read_header.inst will contain in fact a module id
if (new_data_p->pdcp_read_header.inst >= oai_emulation.info.nb_enb_local) {
if (new_data_p->pdcp_read_header.inst >= 1/*oai_emulation.info.nb_enb_local*/) {
module_id = new_data_p->pdcp_read_header.inst
- oai_emulation.info.nb_enb_local +
- 1/*oai_emulation.info.nb_enb_local*/ +
+ oai_emulation.info.first_ue_local;
eNB_flag = 0;
} else {
......
......@@ -72,7 +72,7 @@ mac_rrc_data_req(
)
//--------------------------------------------------------------------------
{
printf("mac_rrc_data_req:eNB_index %d, eNB %d, CC_id %d\n",eNB_index,Mod_idP,CC_id);//eNB_index=ue->common_vars.enb_id
printf("mac_rrc_data_req:eNB_index %d, UE %d, CC_id %d, enb_flag activated? %d\n",eNB_index,Mod_idP,CC_id,enb_flagP == ENB_FLAG_YES);//eNB_index=ue->common_vars.enb_id
SRB_INFO *Srb_info;
uint8_t Sdu_size=0;
......@@ -566,7 +566,7 @@ printf("ENABLE_ITTI is on\n");
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
ctxt_pP->instance,
message_p);
//printf("rrc_data_req: eNB_index %d, rnti %d\n",RRC_DCCH_DATA_REQ (message_p).eNB_index,RRC_DCCH_DATA_REQ (message_p).rnti);
printf("rrc_data_req: ctxt_pP->instance %d, ctxt_pP->module_id %d\n",ctxt_pP->instance,ctxt_pP->module_id);
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
......
......@@ -1224,7 +1224,7 @@ uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv)
msg_p->ittiMsg.rrc_ul_ccch.size = message_string_size;
memcpy(&msg_p->ittiMsg.rrc_ul_ccch.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, NB_eNB_INST + Mod_id, msg_p);
itti_send_msg_to_task(TASK_UNKNOWN, 1/*NB_eNB_INST*/ + Mod_id, msg_p);
}
}
# endif
......@@ -1307,7 +1307,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin
msg_p->ittiMsg.rrc_ul_dcch.size = message_string_size;
memcpy(&msg_p->ittiMsg.rrc_ul_dcch.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, NB_eNB_INST + Mod_id, msg_p);
itti_send_msg_to_task(TASK_UNKNOWN, 1/*NB_eNB_INST*/ + Mod_id, msg_p);
}
}
# endif
......@@ -2517,7 +2517,7 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
msg_p->ittiMsg.rrc_dl_dcch.size = message_string_size;
memcpy(&msg_p->ittiMsg.rrc_dl_dcch.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, NB_eNB_INST + Mod_id, msg_p);
itti_send_msg_to_task(TASK_UNKNOWN, 1/*NB_eNB_INST*/ + Mod_id, msg_p);
}
}
# endif
......@@ -2749,7 +2749,7 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
msg_p = itti_alloc_new_message (TASK_RRC_UE, RRC_UE_EUTRA_CAPABILITY);
memcpy (&msg_p->ittiMsg, (void *) UE_EUTRA_Capability, sizeof(RrcUeEutraCapability));
itti_send_msg_to_task (TASK_UNKNOWN, NB_eNB_INST, msg_p);
itti_send_msg_to_task (TASK_UNKNOWN, 1/*NB_eNB_INST*/, msg_p);
}
# else
{
......
......@@ -460,7 +460,7 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* c
ctxt_pP->module_id,ctxt_pP->frame, size, eNB_index);
LOG_D(RLC,
"[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionSetupComplete to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
ctxt_pP->frame, ctxt_pP->module_id+NB_eNB_INST, size, eNB_index, rrc_mui, ctxt_pP->module_id+NB_eNB_INST, DCCH);
ctxt_pP->frame, ctxt_pP->module_id+1/*NB_eNB_INST*/, size, eNB_index, rrc_mui, ctxt_pP->module_id+1/*NB_eNB_INST*/, DCCH);
rrc_data_req (
ctxt_pP,
DCCH,
......@@ -471,7 +471,7 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* c
PDCP_TRANSMISSION_MODE_CONTROL);
printf("[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionSetupComplete to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
ctxt_pP->frame, ctxt_pP->module_id+NB_eNB_INST, size, eNB_index, rrc_mui, ctxt_pP->module_id+NB_eNB_INST, DCCH);
ctxt_pP->frame, ctxt_pP->module_id+1/*NB_eNB_INST*/, size, eNB_index, rrc_mui, ctxt_pP->module_id+1/*NB_eNB_INST*/, DCCH);
}
//-----------------------------------------------------------------------------
......@@ -4325,7 +4325,6 @@ NAS_KENB_REFRESH_REQ,NAS_CELL_SELECTION_REQ,RRC_STATE_INACTIVE,RRC_STATE_IDLE,RR
itti_receive_msg (TASK_RRC_UE, &msg_p);
msg_name = ITTI_MSG_NAME (msg_p);
printf("rrc_ue_task... wait for a message. Case %d, id %d, instance %d\n",ITTI_MSG_ID(msg_p),ue_mod_id,instance);
instance = ITTI_MSG_INSTANCE (msg_p);
ue_mod_id = UE_INSTANCE_TO_MODULE_ID(instance);
printf("rrc_ue_task... wait for a message. Case %d, id %d, instance %d\n",ITTI_MSG_ID(msg_p),ue_mod_id,instance);
......
......@@ -116,7 +116,7 @@ void rrc_init_mr_req(unsigned char Mod_id, rrci_init_mr_req_t *smsg)
Mac_config_req.Lchan_id.Index=(smsg->CH_index << RAB_SHIFT2) + BCCH;
Index=Mac_rlc_xface->mac_config_req(Mod_id,ADD_LC,&Mac_config_req);
msg("[OPENAIR][RRC][RRC_CONFIG] NODE %d, Config BCCH %d done\n",UE_rrc_inst[Mod_id-NB_CH_INST].Node_id,Index);
printf("rrc_init_mr_req: Mod_id %d, NB_CH_INST %d, smsg->CH_index %d\n",Mod_id, NB_CH_INST,smsg->CH_index);
UE_rrc_inst[Mod_id].Srb0[smsg->CH_index].Srb_id = Index;
memcpy(& UE_rrc_inst[Mod_id-NB_CH_INST].Srb0[smsg->CH_index].Lchan_desc[0],(LCHAN_DESC*)&smsg->Lchan_desc_srb0,LCHAN_DESC_SIZE); //0 rx, 1 tx
memcpy(& UE_rrc_inst[Mod_id-NB_CH_INST].Srb0[smsg->CH_index].Lchan_desc[1],(LCHAN_DESC*)&smsg->Lchan_desc_srb0,LCHAN_DESC_SIZE); //0 rx, 1 tx
......
......@@ -163,7 +163,7 @@ int emm_send_attach_request(const emm_as_establish_t *msg,
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Attach Request message");
printf("EMMAS-SAP - Send Attach Request message, EMM_HEADER_MAXIMUM_LENGTH %d, EPS attach type %d, NAS key id %d, EPS mobile id %d, guti %d\n",EMM_HEADER_MAXIMUM_LENGTH,EMM_HEADER_MAXIMUM_LENGTH+EPS_ATTACH_TYPE_MAXIMUM_LENGTH,EMM_HEADER_MAXIMUM_LENGTH+EPS_ATTACH_TYPE_MAXIMUM_LENGTH+NAS_KEY_SET_IDENTIFIER_MAXIMUM_LENGTH,EMM_HEADER_MAXIMUM_LENGTH+EPS_ATTACH_TYPE_MAXIMUM_LENGTH+NAS_KEY_SET_IDENTIFIER_MAXIMUM_LENGTH+EPS_MOBILE_IDENTITY_MAXIMUM_LENGTH, msg->UEid.guti);
/* Mandatory - Message type */
emm_msg->messagetype = ATTACH_REQUEST;
......
......@@ -354,7 +354,7 @@ static void set_cli_start(module_id_t module_idP, uint8_t start)
if (module_idP < NB_eNB_INST) {
oai_emulation.info.cli_start_enb[module_idP] = start;
} else {
oai_emulation.info.cli_start_ue[module_idP - NB_eNB_INST] = start;
oai_emulation.info.cli_start_ue[module_idP - 1/*NB_eNB_INST*/] = start;
}
}
#endif
......@@ -540,7 +540,7 @@ l2l1_task (void *args_p)
UE_stats[UE_inst] = fopen (UE_stats_filename, "w");
}
for (eNB_inst=0; eNB_inst<NB_eNB_INST; eNB_inst++) {
for (eNB_inst=0; eNB_inst<1/*NB_eNB_INST*/; eNB_inst++) {
sprintf(eNB_stats_filename,"eNB_stats%d.txt",eNB_inst);
eNB_stats[eNB_inst] = fopen (eNB_stats_filename, "w");
}
......
......@@ -1826,9 +1826,9 @@ void init_ocm(void)
void init_otg_pdcp_buffer(void)
{
module_id_t i;
otg_pdcp_buffer = malloc((NB_UE_INST + NB_eNB_INST) * sizeof(Packet_OTG_List_t));
otg_pdcp_buffer = malloc((NB_UE_INST + 1/*NB_eNB_INST*/) * sizeof(Packet_OTG_List_t));
for (i = 0; i < NB_UE_INST + NB_eNB_INST; i++) {
for (i = 0; i < NB_UE_INST + 1/*NB_eNB_INST*/; i++) {
pkt_list_init(&(otg_pdcp_buffer[i]));
//LOG_I(EMU,"HEAD of otg_pdcp_buffer[%d] is %p\n", i, pkt_list_get_head(&(otg_pdcp_buffer[i])));
}
......@@ -1967,7 +1967,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
int dst_id, app_id;
Packet_otg_elt_t *otg_pkt;
printf("update_otg_eNB: enb_module_idP %d\n",enb_module_idP);
for (dst_id = 0; dst_id < NUMBER_OF_UE_MAX; dst_id++) {
for_times += 1;
......@@ -1979,7 +1979,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(enb_module_idP, dst_id + NB_eNB_INST, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(enb_module_idP, dst_id + 1/*NB_eNB_INST*/, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
otg_times += 1;
......@@ -2108,7 +2108,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
int app_id;
if (oai_emulation.info.otg_enabled ==1 ) {
module_id_t dst_id, src_id; //dst_id = eNB_index
module_id_t module_id = ue_mod_idP+NB_eNB_INST;
module_id_t module_id = ue_mod_idP+1/*NB_eNB_INST*/;
src_id = module_id;
......
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