Commit 382eff9d authored by Navid Nikaein's avatar Navid Nikaein

* applying patch 11 contributed from S. Held

* add protocol configuration to OCG XML file


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6629 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 2d84e7cf
......@@ -49,7 +49,7 @@
#include "pss6144.h"
#define DEBUG_TF 1
extern print_shorts(char*,__m128i*);
extern void print_shorts(char*,__m128i*);
void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) {
......
......@@ -508,7 +508,6 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
}
len += sprintf(&buffer[len],"EOF\n");
len += sprintf(&buffer[len],"\0");
return len;
} // is_clusterhead
......@@ -751,7 +750,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
len += sprintf(&buffer[len],"\n");
}
len += sprintf(&buffer[len],"EOF\n");
len += sprintf(&buffer[len],"\0");
return len;
}
......@@ -3640,7 +3640,8 @@ void phy_UE_lte_check_measurement_thresholds(instance_t instanceP, ral_threshold
frame_tx,
subframe_rx,
subframe_select(&phy_vars_ue->lte_frame_parms,subframe_tx),
eNB_id);
eNB_id,
0/*FIXME CC_id*/);
if (ret == CONNECTION_LOST) {
LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",phy_vars_ue->Mod_id,
frame_rx,subframe_tx);
......
......@@ -460,7 +460,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
libconfig_int tdd_config_s;
const char* prefix_type = NULL;
libconfig_int eutra_band;
int64_t downlink_frequency;
long long int downlink_frequency;
libconfig_int uplink_frequency_offset;
libconfig_int Nid_cell;
libconfig_int Nid_cell_mbsfn;
......
......@@ -393,7 +393,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return
offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
1, //num_sdus
&rrc_sdu_length, //
(unsigned short*)&rrc_sdu_length, //
&lcid, // sdu_lcid
255, // no drx
0, // no timing advance
......
......@@ -450,9 +450,10 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
else if( (min_rb_unit[CC_id] * total_ue_count) <= (frame_parms[CC_id]->N_RB_DL) )
average_rbs_per_user[CC_id] = (uint16_t) floor(frame_parms[CC_id]->N_RB_DL/total_ue_count);
else
average_rbs_per_user[CC_id] = min_rb_unit[CC_id];
average_rbs_per_user[CC_id] = min_rb_unit[CC_id]; // consider the total number of use that can be scheduled UE
}
}
// note: nb_rbs_required is assigned according to total_buffer_dl
// extend nb_rbs_required to capture per LCID RB required
for(i=UE_list->head;i>=0;i=UE_list->next[i]){
......@@ -461,14 +462,16 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
// control channel
if (mac_get_rrc_status(Mod_id,1,i) < RRC_RECONFIGURED)
nb_rbs_required_remaining_1[CC_id][i] = nb_rbs_required[CC_id][i];
else
else{
nb_rbs_required_remaining_1[CC_id][i] = cmin(average_rbs_per_user[CC_id],nb_rbs_required[CC_id][i]);
}
}
}
//Allocation to UEs is done in 2 rounds,
// 1st round: average number of RBs allocated to each UE
// 2nd round: remaining RBs are allocated to high priority UEs
// 1st stage: average number of RBs allocated to each UE
// 2nd stage: remaining RBs are allocated to high priority UEs
for(r1=0;r1<2;r1++){
for(i=UE_list->head; i>=0;i=UE_list->next[i]) {
......@@ -511,7 +514,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
// retransmission in data channels
// control channel in the 1st transmission
// data channel for all TM
LOG_D(MAC,"calling dlsch_scheduler_pre_processor_allocate .. \n ");
LOG_T(MAC,"calling dlsch_scheduler_pre_processor_allocate .. \n ");
dlsch_scheduler_pre_processor_allocate (Mod_id,
UE_id,
CC_id,
......
......@@ -933,7 +933,9 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
for (dst_id = 0; dst_id<NUMBER_OF_UE_MAX; dst_id++) {
if (mac_get_rrc_status(ctxt_pP->enb_module_id, ctxt_pP->enb_flag, dst_id ) > 2) {
otg_pkt=packet_gen(src_id, dst_id, 0, ctime, &pkt_size);
unsigned int temp = 0;
otg_pkt = packet_gen( src_id, dst_id, 0, ctime, &temp );
pkt_size = temp;
if (otg_pkt != NULL){
rb_id = dst_id * maxDRB + DTCH;
ctxt.ue_module_id = dst_id;
......
......@@ -416,7 +416,8 @@ rlc_am_write_status_pdu(
rlc_am_write16_bit_field(&byte_pos_p, &bit_pos, 15, pdu_info_pP->nack_list[index].so_end);
}
}
num_bytes = ((unsigned int)byte_pos_p) - ((unsigned int)(&rlc_am_pdu_sn_10_pP->b1));
ptrdiff_t diff = byte_pos_p - &rlc_am_pdu_sn_10_pP->b1; // this is the difference in terms of typeof(byte_pos_p), which is uint8_t
num_bytes = diff;
if (bit_pos > 0) {
num_bytes += 1;
}
......
......@@ -297,7 +297,7 @@ rlc_um_segment_10 (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlc_pP)
sdu_mngt_p->sdu_size);
#endif
}
data_sdu_p = &(sdu_in_buffer->data[sizeof (struct rlc_um_tx_sdu_management) + sdu_mngt_p->sdu_segmented_size]);
data_sdu_p = (char *) &(sdu_in_buffer->data[sizeof (struct rlc_um_tx_sdu_management) + sdu_mngt_p->sdu_segmented_size]);
if (sdu_mngt_p->sdu_remaining_size > pdu_remaining_size) {
#if defined(TRACE_RLC_UM_SEGMENT)
......@@ -744,7 +744,7 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlc_pP)
sdu_mngt_p->sdu_size);
#endif
}
data_sdu_p = &(sdu_in_buffer->data[sizeof (struct rlc_um_tx_sdu_management) + sdu_mngt_p->sdu_segmented_size]);
data_sdu_p = (char*) &(sdu_in_buffer->data[sizeof (struct rlc_um_tx_sdu_management) + sdu_mngt_p->sdu_segmented_size]);
if (sdu_mngt_p->sdu_remaining_size > pdu_remaining_size) {
#if defined(TRACE_RLC_UM_SEGMENT)
......
......@@ -522,7 +522,7 @@ rlc_op_status_t rrc_rlc_remove_rlc (
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
h_rc = hashtable_get(rlc_coll_p, key, &rlc_union_p);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) {
h_rc = hashtable_remove(rlc_coll_p, key);
LOG_D(RLC, "[Frame %05u][%s][RLC_RRC][INST %u/%u][%s %u] RELEASED %s\n",
......
......@@ -174,7 +174,7 @@ typedef struct
void (*dl_phy_sync_success) (module_id_t Mod_id,frame_t frameP, uint8_t CH_index,uint8_t first_sync);
/// Only calls the PDCP for now
UE_L2_STATE_t (*ue_scheduler)(module_id_t Mod_id, frame_t frameP,sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_id);
UE_L2_STATE_t (*ue_scheduler)(module_id_t Mod_id, frame_t frameP,sub_frame_t subframe, lte_subframe_t direction, uint8_t eNB_id, int CC_id);
/// PHY-Config-Dedicated UE
void (*phy_config_dedicated_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
......
......@@ -3265,7 +3265,7 @@ void
switch (rrc_get_state(ue_mod_id)) {
case RRC_STATE_IDLE:
{
if (rrc_get_sub_state(ue_mod_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
if (rrc_get_sub_state(ue_mod_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) {
rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_CONNECTING);
}
break;
......
......@@ -2849,7 +2849,7 @@ int rrc_eNB_decode_ccch(
SRB_INFO * Srb_info) {
/*------------------------------------------------------------------------------*/
module_id_t Idx, ue_mod_id;
module_id_t Idx, ue_mod_id = 0;
asn_dec_rval_t dec_rval;
UL_CCCH_Message_t *ul_ccch_msg = NULL;
RRCConnectionRequest_r8_IEs_t *rrcConnectionRequest;
......
......@@ -487,6 +487,7 @@ void logRecord(const char *file, const char *func, int line, int comp,
log_list_nb_elements++;
}
if(pthread_cond_signal(&log_notify) != 0) {
pthread_mutex_unlock(&log_lock);
return;
}
......
......@@ -82,43 +82,43 @@ pool_buffer_init ()
//memory->mem_blocks[mb_index + index].next = NULL; -> done in memset 0
switch (pool_index) {
case 0:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool0[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool0[index][0]);
break;
case 1:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool1[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool1[index][0]);
break;
case 2:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool2[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool2[index][0]);
break;
case 3:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool3[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool3[index][0]);
break;
case 4:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool4[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool4[index][0]);
break;
case 5:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool5[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool5[index][0]);
break;
case 6:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool6[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool6[index][0]);
break;
case 7:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool7[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool7[index][0]);
break;
case 8:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool8[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool8[index][0]);
break;
case 9:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool9[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool9[index][0]);
break;
case 10:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool10[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool10[index][0]);
break;
case 11:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool11[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool11[index][0]);
break;
case 12:
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool12[index][0]);
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool12[index][0]);
break;
default:;
memory->mem_blocks[mb_index + index].data = NULL; // pool copy
......@@ -300,79 +300,79 @@ check_mem_area (void)
mem_pool *memory = (mem_pool *) &mem_block_var;
for (index = 0; index < MEM_MNGT_MB0_NB_BLOCKS; index++) {
if ((memory->mem_blocks[index].data != &(memory->mem_pool0[index][0])) && (memory->mem_blocks[index].pool_id != MEM_MNGT_POOL_ID0)) {
if ((memory->mem_blocks[index].data != (unsigned char*)&(memory->mem_pool0[index][0])) && (memory->mem_blocks[index].pool_id != MEM_MNGT_POOL_ID0)) {
msg ("[MEM] ERROR POOL0 block index %d\n", index);
}
}
mb_index = MEM_MNGT_MB0_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB1_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool1[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID1)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool1[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID1)) {
msg ("[MEM] ERROR POOL1 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB1_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB2_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool2[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID2)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool2[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID2)) {
msg ("[MEM] ERROR POOL2 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB2_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB3_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool3[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID3)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool3[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID3)) {
msg ("[MEM] ERROR POOL3 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB3_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB4_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool4[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID4)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool4[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID4)) {
msg ("[MEM] ERROR POOL4 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB4_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB5_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool5[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID5)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool5[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID5)) {
msg ("[MEM] ERROR POOL5 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB5_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB6_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool6[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID6)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool6[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID6)) {
msg ("[MEM] ERROR POOL6 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB6_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB7_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool7[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID7)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool7[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID7)) {
msg ("[MEM] ERROR POOL7 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB7_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB8_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool8[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID8)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool8[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID8)) {
msg ("[MEM] ERROR POOL8 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB8_NB_BLOCKS;
for (index = 0; index < MEM_MNGT_MB9_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool9[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID9)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool9[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID9)) {
msg ("[MEM] ERROR POOL9 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB9_NB_BLOCKS;
for (index = mb_index; index < MEM_MNGT_MB10_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool10[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID10)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool10[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID10)) {
msg ("[MEM] ERROR POOL10 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB10_NB_BLOCKS;
for (index = mb_index; index < MEM_MNGT_MB11_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool11[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID11)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool11[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID11)) {
msg ("[MEM] ERROR POOL11 block index %d\n", index);
}
}
mb_index += MEM_MNGT_MB11_NB_BLOCKS;
for (index = mb_index; index < MEM_MNGT_MB12_NB_BLOCKS; index++) {
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool12[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID12)) {
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool12[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID12)) {
msg ("[MEM] ERROR POOL12 block index %d\n", index);
}
}
......
......@@ -467,28 +467,33 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
typedef struct
{
uint16_t priority[11];//pas possible d'acceder au MAX_NUM_LCID
//
uint8_t DCI_aggregation_min;
uint8_t DLSCH_dci_size_bits;
//UL transmission bandwidth in RBs
uint8_t ul_bandwidth[11];
//DL transmission bandwidth in RBs
uint8_t dl_bandwidth[11];
//UL transmission bandwidth in RBs
uint8_t min_ul_bandwidth[11];
//DL transmission bandwidth in RBs
uint8_t min_dl_bandwidth[11];
//aggregated bit rate of non-gbr bearer per UE
uint64_t ue_AggregatedMaximumBitrateDL;
//aggregated bit rate of non-gbr bearer per UE
uint64_t ue_AggregatedMaximumBitrateUL;
//CQI scheduling interval in subframes.
uint16_t cqiSchedInterval;
//Contention resolution timer used during random access
uint8_t mac_ContentionResolutionTimer;
uint16_t max_allowed_rbs[11];
uint8_t max_mcs[11];
uint16_t priority[11];//pas possible d'acceder au MAX_NUM_LCID
//
uint8_t DCI_aggregation_min;
uint8_t DLSCH_dci_size_bits;
//UL transmission bandwidth in RBs
uint8_t ul_bandwidth[11];
//DL transmission bandwidth in RBs
uint8_t dl_bandwidth[11];
//UL transmission bandwidth in RBs
uint8_t min_ul_bandwidth[11];
//DL transmission bandwidth in RBs
uint8_t min_dl_bandwidth[11];
//aggregated bit rate of non-gbr bearer per UE
uint64_t ue_AggregatedMaximumBitrateDL;
//aggregated bit rate of non-gbr bearer per UE
uint64_t ue_AggregatedMaximumBitrateUL;
//CQI scheduling interval in subframes.
uint16_t cqiSchedInterval;
//Contention resolution timer used during random access
uint8_t mac_ContentionResolutionTimer;
uint16_t max_allowed_rbs[11];
uint8_t max_mcs[11];
uint8_t num_groups;
} Mac_config;
/** @defgroup _Predefined_traffic Configuration
......@@ -653,6 +658,24 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
} Emulation_Config;
/* @}*/
/** @defgroup _OSD_basic OAI protocol config
* @ingroup _OCG
* @brief OAI Emulation struct for protocol configuration
* @{*/
typedef struct{
uint8_t num_groups;
} eNB_MAC_Config;
typedef struct
{
eNB_MAC_Config eNB_mac_config; /*!< \brief eNB MAC configuration parameters */
} Protocol_Config;
/* @}*/
/** @defgroup _OSD_basic Basic OpenAirInterface Scenario Descriptor
* @ingroup _OCG
* @brief OAI Emulation struct for OSD_basic
......@@ -762,11 +785,12 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
* @{*/
typedef struct
{
Mac_config mac_config[NUMBER_OF_UE_MAX];
Mac_config mac_config[NUMBER_OF_UE_MAX];
Environment_System_Config environment_system_config; /*!< \brief Evironment configuration */
Topology_Config topology_config; /*!< \brief Topology configuration */
Application_Config application_config; /*!< \brief Applications configuration */
Emulation_Config emulation_config; /*!< \brief Emulation configuration */
Protocol_Config protocol_config; /* specific protocol configuration*/
Info info; /*!< \brief Some important information which should be able to be reached by OAISIM */
char *profile;
} OAI_Emulation;
......
......@@ -199,6 +199,11 @@ static int emu_;
static int omg_;
static int otg_;
/* MAC*/
static int protocol_;
static int mac_;
static int num_groups_;
static int log_;
static int level_;
static int verbosity_;
......@@ -572,7 +577,14 @@ void start_element(void *user_data, const xmlChar *name, const xmlChar **attrs)
} else if (!xmlStrcmp(name,(unsigned char*) "START_UE")) {
cli_start_ue_ = 1;
} else if (!xmlStrcmp(name,(unsigned char*) "PROFILE")) {
} else if (!xmlStrcmp(name,(unsigned char*) "PROTOCOL")) {
protocol_ = 1;
} else if (!xmlStrcmp(name,(unsigned char*) "MAC")) {
mac_ = 1;
} else if (!xmlStrcmp(name,(unsigned char*) "NUM_GROUPS")) {
num_groups_ = 1;
}
else if (!xmlStrcmp(name,(unsigned char*) "PROFILE")) {
profile_ = 1;
} else {
LOG_W(OCG, "One element could not be parsed : unknown element name '%s'\n", name);
......@@ -905,6 +917,12 @@ void end_element(void *user_data, const xmlChar *name) { // called once at the e
cli_start_enb_ = 0;
} else if (!xmlStrcmp(name,(unsigned char*) "START_UE")) {
cli_start_ue_ = 0;
} else if (!xmlStrcmp(name,(unsigned char*) "PROTOCOL")) {
protocol_ = 0;
} else if (!xmlStrcmp(name,(unsigned char*) "MAC")) {
mac_ = 0;
} else if (!xmlStrcmp(name,(unsigned char*) "NUM_GROUPS")) {
num_groups_ = 0;
} else if (!xmlStrcmp(name,(unsigned char*) "PROFILE")) {
profile_ = 0;
}
......@@ -1312,7 +1330,15 @@ void characters(void *user_data, const xmlChar *xmlch, int xmllen) { // called o
oai_emulation.info.cli_start_ue[i] = atoi(ch);
}
}
} else if (profile_) {
}
else if (protocol_) {
if (mac_){
if (num_groups_){
oai_emulation.protocol_config.eNB_mac_config.num_groups=atoi(ch);
}
}
}
else if (profile_) {
oai_emulation.profile = strndup(ch, len);
}
}
......
......@@ -498,13 +498,14 @@ int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p)
subframesSinceCaptureStart = 0;
if (path != NULL) {
strncpy( in_path, sizeof(in_path), path );
strncpy( in_path, path, sizeof(in_path) );
in_path[sizeof(in_path) - 1] = 0; // terminate string
} else {
strcpy( in_path, "oai_opt.pcap" );
}
if (ip != NULL) {
strncpy( in_ip, sizeof(in_ip), ip );
strncpy( in_ip, ip, sizeof(in_ip) );
in_ip[sizeof(in_ip) - 1] = 0; // terminate string
} else {
strcpy( in_ip, "127.0.0.1" );
}
......
......@@ -390,11 +390,10 @@ fc=fopen("/tmp/otg.log","w");;
else
strcpy(traffic_type,"APPLICATION");
if (map_int_to_str(otg_app_type_names,g_otg->application_type[i][j][k]) == -1){
if (map_int_to_str(otg_app_type_names,g_otg->application_type[i][j][k]) == 0){
LOG_E(OTG,"(src=%d, dst=%d, appli %d) : Unknown traffic \n ", i, j,k);
strcpy(traffic,"UKNOWN TRAFFIC");
} else {
//strcpy (traffic, map_int_to_str(otg_app_type_names,g_otg->application_type[i][j][k]));
strncpy (traffic, map_int_to_str(otg_app_type_names,g_otg->application_type[i][j][k]), sizeof(traffic));
traffic[sizeof(traffic) - 1] = 0; // terminate string
}
......
......@@ -431,7 +431,7 @@ void tarmaPrintVideoInit(tarmaVideo_t *video){
input:
output: - random realization of R_s (B/s)
*/
double backgroundRateRnd(){
double backgroundRateRnd(void){
double rate;
rate=pow(10,lognormal_dist(1.3525, 0.1954))/8; /*Byte/s*/;
if(rate>BACKGROUND_RATE_MAX){
......@@ -447,7 +447,7 @@ double backgroundRateRnd(){
input:
output: - random realization of D_s (ms)
*/
int backgroundSessionDurationRnd(){
int backgroundSessionDurationRnd(void){
int duration;
duration = ceil(pow(10,exponential_dist(1/0.3591))*1000); /*ms*/
if(duration<0){
......
......@@ -575,7 +575,8 @@ static void *UE_thread_tx(void *arg) {
UE->frame_tx,
UE->slot_rx>>1,
subframe_select(&UE->lte_frame_parms,UE->slot_tx>>1),
0);
0,
0/*FIXME CC_id*/);
if (ret == CONNECTION_LOST) {
LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",UE->Mod_id,
......@@ -711,7 +712,8 @@ static void *UE_thread_rx(void *arg) {
UE->frame_tx,
UE->slot_rx>>1,
subframe_select(&UE->lte_frame_parms,UE->slot_tx>>1),
0);
0,
0/*FIXME CC_id*/);
if (ret == CONNECTION_LOST) {
LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",UE->Mod_id,
......
......@@ -209,7 +209,8 @@ void init_oai_emulation(void) {
oai_emulation.application_config.customized_traffic.ed_size_pkts[i]= 0;
}
/* protocol config */
oai_emulation.protocol_config.eNB_mac_config.num_groups=1;
oai_emulation.emulation_config.emulation_time_ms = 0;
......@@ -354,7 +355,8 @@ void oaisim_config(void) {
ocg_config_emu();
ocg_config_env();// mobility gen
ocg_config_topo(); // packet tracer using wireshark
// if T is set or ocg enabled
ocg_config_proto();
// if T is set or ocg enabled
if (oai_emulation.info.otg_enabled ) {
set_component_filelog(OTG);
set_component_filelog(OTG_LATENCY);
......@@ -367,10 +369,10 @@ void oaisim_config(void) {
g_log->log_component[OTG_OWD].filelog = 1;*/
ocg_config_app(); // packet generator
}
// add a var to control this, and pass this var to OMG
set_component_filelog(OMG);
LOG_I(OMG,"setting OMG file log \n");
// add a var to control this, and pass this var to OMG
set_component_filelog(OMG);
LOG_I(OMG,"setting OMG file log \n");
}
int olg_config(void) {
......@@ -1180,3 +1182,9 @@ int ocg_config_emu(void){
return 1;
}
void ocg_config_proto(void){
LOG_I(MAC,"num groups is set to %d\n",oai_emulation.protocol_config.eNB_mac_config.num_groups);
}
......@@ -49,7 +49,7 @@ declare OAI_DB_ADMIN_USER_NAME="root"
declare OAI_DB_ADMIN_USER_PASSWORD="linux"
#only one could be set at the time
declare BUILD_LTE="ENB" # ENB, EPC, HSS
declare BUILD_LTE="NONE" # ENB, EPC, HSS
declare HW="EXMIMO" # EXMIMO, USRP, ETHERNET, NONE
declare TARGET="ALL" # ALL, SOFTMODEM, OAISIM, UNISIM, NONE
......
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