Commit 104ed9ad authored by Xenofon Foukas's avatar Xenofon Foukas

Added fixes for multiple eNBs and simulation mode

parent 59ba6f9e
...@@ -1418,6 +1418,9 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change) ...@@ -1418,6 +1418,9 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
config->has_extended_bsr_size = 1; config->has_extended_bsr_size = 1;
config->extended_bsr_size = get_extended_bsr_size(mod_id,i); config->extended_bsr_size = get_extended_bsr_size(mod_id,i);
} }
//TODO: Set index of primary cell
config->has_pcell_carrier_index = 1;
config->pcell_carrier_index = UE_PCCID(mod_id, i);
//TODO: Set carrier aggregation support (boolean) //TODO: Set carrier aggregation support (boolean)
config->has_ca_support = 0; config->has_ca_support = 0;
config->ca_support = 0; config->ca_support = 0;
...@@ -1425,9 +1428,6 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change) ...@@ -1425,9 +1428,6 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
//TODO: Set cross carrier scheduling support (boolean) //TODO: Set cross carrier scheduling support (boolean)
config->has_cross_carrier_sched_support = 1; config->has_cross_carrier_sched_support = 1;
config->cross_carrier_sched_support = 0; config->cross_carrier_sched_support = 0;
//TODO: Set index of primary cell
config->has_pcell_carrier_index = 1;
config->pcell_carrier_index = 1;
//TODO: Set secondary cells configuration //TODO: Set secondary cells configuration
// We do not set it for now. No carrier aggregation support // We do not set it for now. No carrier aggregation support
...@@ -1754,16 +1754,15 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra ...@@ -1754,16 +1754,15 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
//TODO: Set carrier aggregation support (boolean) //TODO: Set carrier aggregation support (boolean)
ue_config[i]->has_ca_support = 0; ue_config[i]->has_ca_support = 0;
ue_config[i]->ca_support = 0; ue_config[i]->ca_support = 0;
//TODO: Set index of primary cell
ue_config[i]->has_pcell_carrier_index = 1;
ue_config[i]->pcell_carrier_index = UE_PCCID(mod_id, i);
if(ue_config[i]->has_ca_support){ if(ue_config[i]->has_ca_support){
//TODO: Set cross carrier scheduling support (boolean) //TODO: Set cross carrier scheduling support (boolean)
ue_config[i]->has_cross_carrier_sched_support = 1; ue_config[i]->has_cross_carrier_sched_support = 1;
ue_config[i]->cross_carrier_sched_support = 0; ue_config[i]->cross_carrier_sched_support = 0;
//TODO: Set index of primary cell
ue_config[i]->has_pcell_carrier_index = 1;
ue_config[i]->pcell_carrier_index = 1;
//TODO: Set secondary cells configuration //TODO: Set secondary cells configuration
// We do not set it for now. No carrier aggregation support // We do not set it for now. No carrier aggregation support
//TODO: Set deactivation timer for secondary cell //TODO: Set deactivation timer for secondary cell
ue_config[i]->has_scell_deactivation_timer = 1; ue_config[i]->has_scell_deactivation_timer = 1;
ue_config[i]->scell_deactivation_timer = 1; ue_config[i]->scell_deactivation_timer = 1;
...@@ -1874,9 +1873,9 @@ int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__Progr ...@@ -1874,9 +1873,9 @@ int enb_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__Progr
protocol__prp_cell_config__init(cell_conf[i]); protocol__prp_cell_config__init(cell_conf[i]);
//TODO: Fill in with actual value, the PCI of this cell //TODO: Fill in with actual value, the PCI of this cell
cell_conf[i]->phy_cell_id = 1; cell_conf[i]->phy_cell_id = 1;
cell_conf[i]->has_phy_cell_id = 1; cell_conf[i]->has_phy_cell_id = get_cell_id(enb_id,i);
//TODO: Fill in with actual value, the PLMN cell id of this cell //TODO: Fill in with actual value, the PLMN cell id of this cell
cell_conf[i]->cell_id = get_cell_id(enb_id,i); cell_conf[i]->cell_id = i;
cell_conf[i]->has_cell_id = 1; cell_conf[i]->has_cell_id = 1;
//TODO: Fill in with actual value, PUSCH resources in RBs for hopping //TODO: Fill in with actual value, PUSCH resources in RBs for hopping
cell_conf[i]->pusch_hopping_offset = get_hopping_offset(enb_id,i); cell_conf[i]->pusch_hopping_offset = get_hopping_offset(enb_id,i);
......
...@@ -644,6 +644,9 @@ void rrc_eNB_emulation_notify_ue_module_id( ...@@ -644,6 +644,9 @@ void rrc_eNB_emulation_notify_ue_module_id(
// find enb_module_id // find enb_module_id
for (enb_module_id = 0; enb_module_id < NUMBER_OF_eNB_MAX; enb_module_id++) { for (enb_module_id = 0; enb_module_id < NUMBER_OF_eNB_MAX; enb_module_id++) {
if(enb_module_id>1){ /*FIX LATER*/
return;
}
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
if (eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1 != NULL) { if (eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1 != NULL) {
if ( if (
...@@ -652,7 +655,6 @@ void rrc_eNB_emulation_notify_ue_module_id( ...@@ -652,7 +655,6 @@ void rrc_eNB_emulation_notify_ue_module_id(
(eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[2] == cell_identity_byte2P) && (eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[2] == cell_identity_byte2P) &&
(eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[3] == cell_identity_byte3P) (eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[3] == cell_identity_byte3P)
) { ) {
oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_id][ue_module_idP] = rntiP;
ue_context_p = rrc_eNB_get_ue_context( ue_context_p = rrc_eNB_get_ue_context(
&eNB_rrc_inst[enb_module_id], &eNB_rrc_inst[enb_module_id],
rntiP rntiP
...@@ -662,10 +664,11 @@ void rrc_eNB_emulation_notify_ue_module_id( ...@@ -662,10 +664,11 @@ void rrc_eNB_emulation_notify_ue_module_id(
oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_module_id][ue_context_p->local_uid] = ue_module_idP; oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_module_id][ue_context_p->local_uid] = ue_module_idP;
} }
return; //return;
} }
} }
} }
oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_id][ue_module_idP] = rntiP;
} }
AssertFatal(enb_module_id == NUMBER_OF_eNB_MAX, AssertFatal(enb_module_id == NUMBER_OF_eNB_MAX,
...@@ -4026,8 +4029,8 @@ rrc_eNB_decode_dcch( ...@@ -4026,8 +4029,8 @@ rrc_eNB_decode_dcch(
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED \n", PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED \n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
//WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future //WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future
if (mac_agent_registered[ctxt_pP->eNB_index]) { if (mac_agent_registered[ctxt_pP->module_id]) {
agent_mac_xface[ctxt_pP->eNB_index]->enb_agent_notify_ue_state_change(ctxt_pP->eNB_index, agent_mac_xface[ctxt_pP->eNB_index]->enb_agent_notify_ue_state_change(ctxt_pP->module_id,
ue_context_p->ue_id_rnti, ue_context_p->ue_id_rnti,
PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_UPDATED); PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_UPDATED);
} }
...@@ -4116,8 +4119,8 @@ rrc_eNB_decode_dcch( ...@@ -4116,8 +4119,8 @@ rrc_eNB_decode_dcch(
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_CONNECTED \n", LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_CONNECTED \n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
//WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future //WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future
if (mac_agent_registered[ctxt_pP->eNB_index]) { if (mac_agent_registered[ctxt_pP->module_id]) {
agent_mac_xface[ctxt_pP->eNB_index]->enb_agent_notify_ue_state_change(ctxt_pP->eNB_index, agent_mac_xface[ctxt_pP->eNB_index]->enb_agent_notify_ue_state_change(ctxt_pP->module_id,
ue_context_p->ue_id_rnti, ue_context_p->ue_id_rnti,
PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_ACTIVATED); PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_ACTIVATED);
} }
......
...@@ -270,13 +270,14 @@ unsigned char *packet_gen( ...@@ -270,13 +270,14 @@ unsigned char *packet_gen(
char *header=NULL; char *header=NULL;
int header_size = 0; int header_size = 0;
//LOG_I(OTG,"Src: %d - Dest: %d - before exit\n",src_instance,dst_instance);
// check if the app is configured // check if the app is configured
if (app >= g_otg->application_idx[src_instance][dst_instance]) { if (app >= g_otg->application_idx[src_instance][dst_instance]) {
//LOG_I(OTG,"Src: %d - Dest: %d - no packet to generate - no application\n",src_instance,dst_instance);
return NULL; return NULL;
} }
LOG_T(OTG,"[src %d] [dst %d ][APP %d] current time %d\n",src_instance, dst_instance, app, ctime); //LOG_I(OTG,"[src %d] [dst %d ][APP %d] current time %d\n",src_instance, dst_instance, app, ctime);
*pkt_size=0; *pkt_size=0;
init_packet_gen(src_instance, dst_instance,ctime); init_packet_gen(src_instance, dst_instance,ctime);
......
...@@ -498,7 +498,6 @@ l2l1_task (void *args_p) ...@@ -498,7 +498,6 @@ l2l1_task (void *args_p)
xargv[0] = xname; xargv[0] = xname;
fl_initialize (&xargc, xargv, NULL, 0, 0); fl_initialize (&xargc, xargv, NULL, 0, 0);
eNB_inst = 0; eNB_inst = 0;
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) { for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
// DL scope at UEs // DL scope at UEs
...@@ -849,7 +848,7 @@ l2l1_task (void *args_p) ...@@ -849,7 +848,7 @@ l2l1_task (void *args_p)
update_otg_UE (UE_inst, oai_emulation.info.time_ms); update_otg_UE (UE_inst, oai_emulation.info.time_ms);
//Access layer //Access layer
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame, next_slot); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, ENB_FLAG_NO, NOT_A_RNTI, frame, next_slot>>1, 0);
pdcp_run (&ctxt); pdcp_run (&ctxt);
#endif #endif
......
...@@ -1326,13 +1326,11 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) ...@@ -1326,13 +1326,11 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
// generate traffic if the ue is rrc reconfigured state // generate traffic if the ue is rrc reconfigured state
//if ((rrc_state=mac_eNB_get_rrc_status(enb_module_idP, dst_id)) > 2 /*RRC_CONNECTED*/ ) { //if ((rrc_state=mac_eNB_get_rrc_status(enb_module_idP, dst_id)) > 2 /*RRC_CONNECTED*/ ) {
if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){ if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){
if_times += 1; if_times += 1;
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) { for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
otg_pkt = malloc (sizeof(Packet_otg_elt_t)); 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 + NB_eNB_INST, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) { if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
...@@ -1459,6 +1457,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) ...@@ -1459,6 +1457,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
{ {
#if defined(USER_MODE) && defined(OAI_EMU) #if defined(USER_MODE) && defined(OAI_EMU)
int app_id;
if (oai_emulation.info.otg_enabled ==1 ) { if (oai_emulation.info.otg_enabled ==1 ) {
module_id_t dst_id, src_id; //dst_id = eNB_index 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+NB_eNB_INST;
...@@ -1468,6 +1467,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) ...@@ -1468,6 +1467,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
for (dst_id=0; dst_id<NB_SIG_CNX_UE; dst_id++) { for (dst_id=0; dst_id<NB_SIG_CNX_UE; dst_id++) {
// only consider the first attached eNB // only consider the first attached eNB
if (mac_UE_get_rrc_status(ue_mod_idP, dst_id ) > 2 /*RRC_CONNECTED*/) { if (mac_UE_get_rrc_status(ue_mod_idP, dst_id ) > 2 /*RRC_CONNECTED*/) {
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
Packet_otg_elt_t *otg_pkt = malloc (sizeof(Packet_otg_elt_t)); Packet_otg_elt_t *otg_pkt = malloc (sizeof(Packet_otg_elt_t));
if (otg_pkt!=NULL) if (otg_pkt!=NULL)
...@@ -1477,7 +1477,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) ...@@ -1477,7 +1477,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
exit(-1); exit(-1);
}// Manage to add this packet to the tail of your list }// Manage to add this packet to the tail of your list
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(src_id, dst_id, 0, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size)); (otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(src_id, dst_id, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) { if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
(otg_pkt->otg_pkt).rb_id = DTCH-2; (otg_pkt->otg_pkt).rb_id = DTCH-2;
...@@ -1496,6 +1496,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) ...@@ -1496,6 +1496,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
} }
} }
} }
}
#endif #endif
} }
......
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