Commit 2f0646f3 authored by Navid Nikaein's avatar Navid Nikaein

* add a ulsch scheduler and preprocessor

* check for false msg3 detection at the MAC layer, and indicate PHY tp cancel the RA proc 
* fix few compilation errors for Rel10


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5824 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent b79bd77b
......@@ -223,7 +223,7 @@ hashtable_rc_t hashtable_remove(hash_table_t *hashtblP, const hash_key_t keyP)
hash=hashtblP->hashfunc(keyP)%hashtblP->size;
node=hashtblP->nodes[hash];
while(node) {
if(node->key != keyP) {
if(node->key == keyP) {
if(prevnode) prevnode->next=node->next;
else hashtblP->nodes[hash]=node->next;
if (node->data) {
......
......@@ -86,6 +86,21 @@ int32_t lte_segmentation(uint8_t *input_buffer,
uint32_t *Kminus,
uint32_t *F);
/** \fn int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs)
\brief this functions calculates the delta MCS in dB based on the lte_segmentation function
\param tbs transport block size
\param nb_rb number of required rb
\param control_only a flag for the type of data
\param ncp cyclic prefix
\param use_srs a flag indicating the use of srs in the current SF
\returns ue_tx_power estimated ue tx power = delat_ mcs + bw_factor
*/
int16_t estimate_ue_tx_power(uint32_t tbs,
uint32_t nb_rb,
uint8_t control_only,
lte_prefix_type_t ncp,
uint8_t use_srs);
/** \fn uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
\brief This is the subblock interleaving algorithm from 36-212 (Release 8, 8.6 2009-03), pages 15-16.
This function takes the d-sequence and generates the w-sequence. The nu-sequence from 36-212 is implicit.
......
......@@ -32,6 +32,7 @@
date: 21.10.2009
*/
#include "PHY/defs.h"
#include "SCHED/extern.h"
//#define DEBUG_SEGMENTATION
......@@ -166,6 +167,72 @@ int lte_segmentation(unsigned char *input_buffer,
return(0);
}
// uint8_t eNB_id,uint8_t harq_pid, uint8_t UE_id,
int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs){
/// The payload + CRC size in bits, "B"
uint32_t B;
/// Number of code segments
uint32_t C;
/// Number of "small" code segments
uint32_t Cminus;
/// Number of "large" code segments
uint32_t Cplus;
/// Number of bits in "small" code segments (<6144)
uint32_t Kminus;
/// Number of bits in "large" code segments (<6144)
uint32_t Kplus;
/// Total number of bits across all segments
uint32_t sumKr;
/// Number of "Filler" bits
uint32_t F;
// num resource elements
uint32_t num_re=0.0;
// num symbols
uint32_t num_symb=0.0;
/// effective spectral efficiency of the PUSCH
uint32_t MPR_x100=0;
/// beta_offset
uint16_t beta_offset_pusch_x8=8;
/// delta mcs
float delta_mcs=0.0;
/// bandwidth factor
float bw_factor=0.0;
B= tbs+24;
lte_segmentation(NULL,
NULL,
B,
&C,
&Cplus,
&Cminus,
&Kplus,
&Kminus,
&F);
sumKr = Cminus*Kminus + Cplus*Kplus;
num_symb = 12-(ncp<<1)-(use_srs==0?0:1);
num_re = num_symb * nb_rb * 12;
if (num_re == 0)
return(0);
MPR_x100 = 100*sumKr/num_re;
if (control_only == 1 )
beta_offset_pusch_x8=8; // fixme
//(beta_offset_pusch_x8=phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->control_only == 1) ? phy_vars_ue->ulsch_ue[eNB_id]->beta_offset_cqi_times8:8;
// if deltamcs_enabledm
delta_mcs = ((hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch_x8)>>3))/100.0);
bw_factor = (hundred_times_log10_NPRB[nb_rb-1]/100.0);
#ifdef DEBUG_SEGMENTATION
printf("estimated ue tx power %d (num_re %d, sumKr %d, mpr_x100 %d, delta_mcs %f, bw_factor %f)\n",
(int16_t)ceil(delta_mcs + bw_factor), num_re, sumKr, MPR_x100, delta_mcs, bw_factor);
#endif
return (int16_t)ceil(delta_mcs + bw_factor);
}
#ifdef MAIN
main() {
......
......@@ -51,10 +51,10 @@
* Memory Initializaion and Cleanup for LTE MODEM.
* @{
\section _Memory_init_ Memory Initialization for LTE MODEM
Blah Blah
*/
#define DEBUG_PHY
//#define DEBUG_PHY
/*
#ifndef USER_MODE
......
......@@ -77,6 +77,8 @@ extern int synch_wait_cnt;
extern OPENAIR_DAQ_VARS openair_daq_vars;
extern int16_t hundred_times_delta_TF[100];
extern uint16_t hundred_times_log10_NPRB[100];
/*
#ifdef EMOS
extern fifo_dump_emos_UE emos_dump_UE;
......
......@@ -3132,7 +3132,18 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->ulsch_eNB[i]->rnti,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3,
harq_pid);
harq_pid,
&phy_vars_eNB->ulsch_eNB[i]->Msg3_flag);
// false msg3 detection by MAC: empty PDU
if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) {
phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
phy_vars_eNB->CC_id,
frame,
phy_vars_eNB->eNB_UE_stats[i].crnti);
remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag);
phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0;
}
/*
mac_xface->terminate_ra_proc(phy_vars_eNB->Mod_id,
frame,
......@@ -3193,7 +3204,8 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->ulsch_eNB[i]->rnti,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3,
harq_pid);
harq_pid,
NULL);
//}
/*
else {
......@@ -3663,7 +3675,9 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->ulsch_eNB[i]->rnti,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3,
harq_pid);
harq_pid,
NULL);
phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]=1;//(subframe);
} else {
LOG_N(PHY,"[eNB %d] Frame %d subframe %d : CBA collision detected for UE%d for group %d, set the SR for this UE \n ",
......
......@@ -466,6 +466,8 @@ typedef struct{
uint64_t total_pdu_bytes_rx;
// total num pdu
uint32_t total_num_pdus_rx;
// num of error pdus
uint32_t total_num_errors_rx;
}eNB_UE_STATS;
......@@ -496,11 +498,23 @@ typedef struct{
uint8_t DLSCH_DCI[8][(MAX_DCI_SIZE_BITS>>3)+1];
/// Number of Allocated RBs for DL after scheduling (prior to frequency allocation)
uint16_t nb_rb[8];
uint16_t nb_rb[8]; // num_max_harq
/// Number of Allocated RBs for UL after scheduling (prior to frequency allocation)
uint16_t nb_rb_ul[8];
uint16_t nb_rb_ul[8]; // num_max_harq
/// Number of Allocated RBs by the ulsch preprocessor
uint8_t pre_allocated_nb_rb_ul;
/// index of Allocated RBs by the ulsch preprocessor
int8_t pre_allocated_rb_table_index_ul;
/// total allocated RBs
int8_t total_allocated_rbs;
/// assigned MCS by the ulsch preprocessor
uint8_t pre_assigned_mcs_ul;
/// DCI buffer for ULSCH
uint8_t ULSCH_DCI[8][(MAX_DCI_SIZE_BITS>>3)+1];
......@@ -524,6 +538,9 @@ typedef struct{
/// phr information
int8_t phr_info;
/// phr information
int8_t phr_info_configured;
//dl buffer info
uint32_t dl_buffer_info[MAX_NUM_LCID];
......@@ -541,6 +558,15 @@ typedef struct{
uint32_t dl_buffer_head_sdu_remaining_size_to_send[MAX_NUM_LCID];
// uplink info
uint32_t ul_total_buffer;
uint32_t ul_buffer_creation_time[MAX_NUM_LCGID];
uint32_t ul_buffer_creation_time_max;
uint32_t ul_buffer_info[MAX_NUM_LCGID];
} UE_TEMPLATE;
typedef struct{
......@@ -644,7 +670,9 @@ typedef struct{
UE_sched_ctrl UE_sched_ctrl[NUMBER_OF_UE_MAX];
int next[NUMBER_OF_UE_MAX];
int head;
int head;
int next_ul[NUMBER_OF_UE_MAX];
int head_ul;
int avail;
int num_UEs;
boolean_t active[NUMBER_OF_UE_MAX];
......
......@@ -1695,6 +1695,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP
// Get candidate harq_pid from PHY
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,0);
if (round>0) {
//RA_template->wait_ack_Msg4++;
// we have to schedule a retransmission
if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD)
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
......@@ -1733,6 +1734,11 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP
module_idP,frameP,subframeP,RA_template->rnti);
}
else {
/* msg4 not received
if ((round == 0) && (RA_template->wait_ack_Msg4>1){
remove UE instance across all the layers: mac_xface->cancel_RA();
}
*/
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,frameP,subframeP);
RA_template->wait_ack_Msg4=0;
RA_template->RA_active=FALSE;
......
......@@ -195,11 +195,16 @@ uint8_t find_num_active_UEs_in_cbagroup(module_id_t module_idP, int CC_id,unsign
}
#endif
void dump_ue_list(UE_list_t *listP) {
void dump_ue_list(UE_list_t *listP, int ul_flag) {
int j;
for (j=listP->head;j>=0;j=listP->next[j]) {
LOG_T(MAC,"node %d => %d\n",j,listP->next[j]);
if ( ul_flag == 0 ){
for (j=listP->head;j>=0;j=listP->next[j]) {
LOG_T(MAC,"node %d => %d\n",j,listP->next[j]);
}
} else {
for (j=listP->head_ul;j>=0;j=listP->next_ul[j]) {
LOG_T(MAC,"node %d => %d\n",j,listP->next_ul[j]);
}
}
}
......@@ -210,14 +215,15 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) {
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
LOG_D(MAC,"[eNB %d, CC_id %d] Adding UE with rnti %x (next avail %d, num_UEs %d)\n",mod_idP,cc_idP,rntiP,UE_list->avail,UE_list->num_UEs);
dump_ue_list(UE_list);
dump_ue_list(UE_list,0);
if (UE_list->avail>=0) {
UE_id = UE_list->avail;
UE_list->avail = UE_list->next[UE_list->avail];
UE_list->next[UE_id] = UE_list->head;
UE_list->next_ul[UE_id] = UE_list->head;
UE_list->head = UE_id;
UE_list->head_ul = UE_id;
UE_list->UE_template[cc_idP][UE_id].rnti = rntiP;
UE_list->UE_template[cc_idP][UE_id].configured = FALSE;
UE_list->numactiveCCs[UE_id] = 1;
......@@ -235,24 +241,24 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) {
eNB_ulsch_info[mod_idP][UE_id].status = S_UL_WAITING;
eNB_dlsch_info[mod_idP][UE_id].status = S_UL_WAITING;
LOG_D(MAC,"[eNB %d] Add UE_id %d on Primary CC_id %d: rnti %x\n",mod_idP,UE_id,cc_idP,rntiP);
dump_ue_list(UE_list);
dump_ue_list(UE_list,0);
return(UE_id);
}
LOG_E(MAC,"error in add_new_ue(), could not find space in UE_list, Dumping UE list\n");
dump_ue_list(UE_list);
dump_ue_list(UE_list,0);
return(-1);
}
int mac_remove_ue(module_id_t mod_idP, int ue_idP) {
int prev,i;
int prev,i, ret=-1;
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
int pCC_id = UE_PCCID(mod_idP,ue_idP);
LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",ue_idP,pCC_id, UE_list->UE_template[pCC_id][ue_idP].rnti);
dump_ue_list(UE_list);
dump_ue_list(UE_list,0);
// clear all remaining pending transmissions
UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID0] = 0;
......@@ -283,15 +289,32 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP) {
UE_list->avail = i;
UE_list->active[i] = FALSE;
UE_list->num_UEs--;
return(0);
ret=0;
break;
}
prev=i;
}
// do the same for UL
prev = UE_list->head_ul;
for (i=UE_list->head_ul;i>=0;i=UE_list->next_ul[i]) {
if (i == ue_idP) {
// link prev to next in Active list
if (prev==UE_list->head_ul)
UE_list->head_ul = UE_list->next_ul[i];
else
UE_list->next_ul[prev] = UE_list->next_ul[i];
// add UE id (i)to available
UE_list->next_ul[i] = UE_list->avail;
ret = 0;
break;
}
prev=i;
}
if (ret == 0)
return (0);
LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",ue_idP);
dump_ue_list(UE_list);
dump_ue_list(UE_list,0);
mac_xface->macphy_exit("");
return(-1);
......@@ -299,84 +322,146 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP) {
int prev(UE_list_t *listP, int nodeP) {
int prev(UE_list_t *listP, int nodeP, int ul_flag) {
int j;
if (nodeP==listP->head)
return(nodeP);
for (j=listP->head;j>=0;j=listP->next[j]) {
if (listP->next[j]==nodeP)
return(j);
if (ul_flag == 0 ) {
if (nodeP==listP->head)
return(nodeP);
for (j=listP->head;j>=0;j=listP->next[j]) {
if (listP->next[j]==nodeP)
return(j);
}
} else {
if (nodeP==listP->head_ul)
return(nodeP);
for (j=listP->head_ul;j>=0;j=listP->next_ul[j]) {
if (listP->next_ul[j]==nodeP)
return(j);
}
}
LOG_E(MAC,"error in prev(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",nodeP);
dump_ue_list(listP);
LOG_E(MAC,"error in prev(), could not find previous to %d in UE_list %s, should never happen, Dumping UE list\n",
nodeP, (ul_flag == 0)? "DL" : "UL");
dump_ue_list(listP, ul_flag);
return(-1);
}
void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP) {
void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) {
int prev_i,prev_j,next_i,next_j;
LOG_D(MAC,"Swapping UE %d,%d\n",nodeiP,nodejP);
dump_ue_list(listP);
LOG_T(MAC,"Swapping UE %d,%d\n",nodeiP,nodejP);
dump_ue_list(listP,ul_flag);
prev_i = prev(listP,nodeiP);
prev_j = prev(listP,nodejP);
prev_i = prev(listP,nodeiP,ul_flag);
prev_j = prev(listP,nodejP,ul_flag);
if ((prev_i<0) || (prev_j<0))
mac_xface->macphy_exit("");
next_i = listP->next[nodeiP];
next_j = listP->next[nodejP];
LOG_D(MAC,"next_i %d, next_i, next_j %d, head %d\n",next_i,next_j,listP->head);
if (next_i == nodejP) { // case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...
LOG_D(MAC,"Case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...\n");
listP->next[nodeiP] = next_j;
listP->next[nodejP] = nodeiP;
if (nodeiP==listP->head) // case i j n(j)
listP->head = nodejP;
else
listP->next[prev_i] = nodejP;
}
else if (next_j == nodeiP) { // case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...
LOG_D(MAC,"Case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...\n");
listP->next[nodejP] = next_i;
listP->next[nodeiP] = nodejP;
if (nodejP==listP->head) // case j i n(i)
listP->head = nodeiP;
else
listP->next[prev_j] = nodeiP;
if (ul_flag == 0){
next_i = listP->next[nodeiP];
next_j = listP->next[nodejP];
} else {
next_i = listP->next_ul[nodeiP];
next_j = listP->next_ul[nodejP];
}
else { // case ... p(i) i n(i) ... p(j) j n(j) ...
listP->next[nodejP] = next_i;
listP->next[nodeiP] = next_j;
LOG_T(MAC,"[%s] next_i %d, next_i, next_j %d, head %d \n",
(ul_flag == 0)? "DL" : "UL",
next_i,next_j,listP->head);
if (nodeiP==listP->head) {
LOG_D(MAC,"changing head to %d\n",nodejP);
listP->head=nodejP;
listP->next[prev_j] = nodeiP;
if (ul_flag == 0 ) {
if (next_i == nodejP) { // case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...
LOG_T(MAC,"Case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...\n");
listP->next[nodeiP] = next_j;
listP->next[nodejP] = nodeiP;
if (nodeiP==listP->head) // case i j n(j)
listP->head = nodejP;
else
listP->next[prev_i] = nodejP;
}
else if (nodejP==listP->head){
LOG_D(MAC,"changing head to %d\n",nodeiP);
listP->head=nodeiP;
listP->next[prev_i] = nodejP;
else if (next_j == nodeiP) { // case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...
LOG_T(MAC,"Case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...\n");
listP->next[nodejP] = next_i;
listP->next[nodeiP] = nodejP;
if (nodejP==listP->head) // case j i n(i)
listP->head = nodeiP;
else
listP->next[prev_j] = nodeiP;
}
else {
listP->next[prev_i] = nodejP;
listP->next[prev_j] = nodeiP;
else { // case ... p(i) i n(i) ... p(j) j n(j) ...
listP->next[nodejP] = next_i;
listP->next[nodeiP] = next_j;
if (nodeiP==listP->head) {
LOG_T(MAC,"changing head to %d\n",nodejP);
listP->head=nodejP;
listP->next[prev_j] = nodeiP;
}
else if (nodejP==listP->head){
LOG_D(MAC,"changing head to %d\n",nodeiP);
listP->head=nodeiP;
listP->next[prev_i] = nodejP;
}
else {
listP->next[prev_i] = nodejP;
listP->next[prev_j] = nodeiP;
}
}
} else { // ul_flag
if (next_i == nodejP) { // case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...
LOG_T(MAC,"[UL] Case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...\n");
listP->next_ul[nodeiP] = next_j;
listP->next_ul[nodejP] = nodeiP;
if (nodeiP==listP->head_ul) // case i j n(j)
listP->head_ul = nodejP;
else
listP->next_ul[prev_i] = nodejP;
}
else if (next_j == nodeiP) { // case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...
LOG_T(MAC,"[UL]Case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...\n");
listP->next_ul[nodejP] = next_i;
listP->next_ul[nodeiP] = nodejP;
if (nodejP==listP->head_ul) // case j i n(i)
listP->head_ul = nodeiP;
else
listP->next_ul[prev_j] = nodeiP;
}
else { // case ... p(i) i n(i) ... p(j) j n(j) ...
listP->next_ul[nodejP] = next_i;
listP->next_ul[nodeiP] = next_j;
if (nodeiP==listP->head_ul) {
LOG_T(MAC,"[UL]changing head to %d\n",nodejP);
listP->head_ul=nodejP;
listP->next_ul[prev_j] = nodeiP;
}
else if (nodejP==listP->head_ul){
LOG_T(MAC,"[UL]changing head to %d\n",nodeiP);
listP->head_ul=nodeiP;
listP->next_ul[prev_i] = nodejP;
}
else {
listP->next_ul[prev_i] = nodejP;
listP->next_ul[prev_j] = nodeiP;
}
}
}
LOG_D(MAC,"After swap\n");
dump_ue_list(listP);
LOG_T(MAC,"After swap\n");
dump_ue_list(listP,ul_flag);
}
void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) {
......
This diff is collapsed.
......@@ -90,6 +90,7 @@ extern int cqi_to_mcs[16];
extern uint32_t RRC_CONNECTION_FLAG;
extern uint8_t rb_table[33];
extern DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
......
......@@ -157,11 +157,14 @@ int mac_top_init(int eMBMS_active, uint8_t cba_group_active, uint8_t HO_active){
UE_list->num_UEs=0;
UE_list->head=-1;
UE_list->head_ul=-1;
UE_list->avail=0;
for (list_el=0;list_el<NUMBER_OF_UE_MAX-1;list_el++) {
UE_list->next[list_el]=list_el+1;
UE_list->next_ul[list_el]=list_el+1;
}
UE_list->next[list_el]=-1;
UE_list->next_ul[list_el]=-1;
#ifdef PHY_EMUL
Mac_rlc_xface->Is_cluster_head[Mod_id]=2;//0: MR, 1: CH, 2: not CH neither MR
......@@ -481,6 +484,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, uint8_t cba_group_
#ifdef CBA
mac_xface->phy_config_cba_rnti = phy_config_cba_rnti ;
#endif
mac_xface->estimate_ue_tx_power = estimate_ue_tx_power;
mac_xface->phy_config_meas_ue = phy_config_meas_ue;
mac_xface->phy_reset_ue = phy_reset_ue;
......
This diff is collapsed.
......@@ -269,8 +269,9 @@ void cancel_ra_proc(module_id_t module_idP,int CC_id,frame_t frameP, uint16_t pr
@param rnti RNTI of UE transmitting the SR
@param sdu Pointer to received SDU
@param harq_pid Index of harq process corresponding to this sdu
@param msg3_flag flag indicating that this sdu is msg3
*/
void rx_sdu(module_id_t module_idP, int CC_id,frame_t frameP, rnti_t rnti, uint8_t *sdu, uint16_t sdu_len, int harq_pid);
void rx_sdu(module_id_t module_idP, int CC_id,frame_t frameP, rnti_t rnti, uint8_t *sdu, uint16_t sdu_len, int harq_pid,uint8_t *msg3_flag);
/* \brief Function to indicate a scheduled schduling request (SR) was received by eNB.
@param Mod_id Instance ID of eNB
......@@ -473,12 +474,22 @@ int mac_init(void);
int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid);
int mac_remove_ue(module_id_t Mod_id, int UE_id);
void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP);
int prev(UE_list_t *listP, int nodeP);
int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag);
void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag);
int prev(UE_list_t *listP, int nodeP, int ul_flag);
void dump_ue_list(UE_list_t *listP, int ul_flag);
int UE_num_active_CC(UE_list_t *listP,int ue_idP);
int UE_PCCID(module_id_t mod_idP,int ue_idP);
rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP);
void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb, uint8_t aggregattion, uint32_t *nCCE);
void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP);
void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP);
void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP,uint16_t *first_rb);
void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_template);
/*! \fn UE_L2_state_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_index)
\brief UE scheduler where all the ue background tasks are done. This function performs the following: 1) Trigger PDCP every 5ms 2) Call RRC for link status return to PHY3) Perform SR/BSR procedures for scheduling feedback 4) Perform PHR procedures.
\param[in] module_idP instance of the UE
......
......@@ -210,7 +210,7 @@ uint32_t ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_i
int gapOffset = -1;
int T = 0;
DevCheck(module_idP < NB_UE_INST, module_idP, NB_UE_INST, 0);
DevCheck(module_idP < (int)NB_UE_INST, module_idP, NB_UE_INST, 0);
if (CC_id>0) {
LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n");
......@@ -219,12 +219,6 @@ uint32_t ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_i
}
// determin the measurement gap
LOG_D(MAC,"[UE %d][SR %x] Frame %d subframe %d PHY asks for SR (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d\n",
module_idP,rnti,frameP,subframe,
UE_mac_inst[module_idP].scheduling_info.SR_COUNTER,
(1<<(2+UE_mac_inst[module_idP].physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax)),
UE_mac_inst[module_idP].scheduling_info.SR_pending);
if (UE_mac_inst[module_idP].measGapConfig !=NULL){
if (UE_mac_inst[module_idP].measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp0){
MGRP= 40;
......@@ -243,10 +237,18 @@ uint32_t ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_i
return(0);
}
}
if ((UE_mac_inst[module_idP].scheduling_info.SR_pending==1) &&
if ((UE_mac_inst[module_idP].physicalConfigDedicated != NULL) &&
(UE_mac_inst[module_idP].scheduling_info.SR_pending==1) &&
(UE_mac_inst[module_idP].scheduling_info.SR_COUNTER <
(1<<(2+UE_mac_inst[module_idP].physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax)))
){
LOG_D(MAC,"[UE %d][SR %x] Frame %d subframe %d PHY asks for SR (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d\n",
module_idP,rnti,frameP,subframe,
UE_mac_inst[module_idP].scheduling_info.SR_COUNTER,
(1<<(2+UE_mac_inst[module_idP].physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax)),
UE_mac_inst[module_idP].scheduling_info.SR_pending);
UE_mac_inst[module_idP].scheduling_info.SR_COUNTER++;
// start the sr-prohibittimer : rel 9 and above
if (UE_mac_inst[module_idP].scheduling_info.sr_ProhibitTimer > 0) { // timer configured
......@@ -1425,6 +1427,7 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
if (UE_mac_inst[module_idP].RA_contention_resolution_cnt ==
((1+rach_ConfigCommon->ra_SupervisionInfo.mac_ContentionResolutionTimer)<<3)) {
UE_mac_inst[module_idP].RA_active = 0;
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0;
// Signal PHY to quit RA procedure
LOG_E(MAC,"Module id %u Contention resolution timer expired, RA failed\n", module_idP);
mac_xface->ra_failed(module_idP,0,eNB_indexP);
......@@ -1488,26 +1491,27 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
// Put this in a function
// Call PHR procedure as described in Section 5.4.6 in 36.321
if (UE_mac_inst[module_idP].PHR_state == MAC_MainConfig__phr_Config_PR_setup){ // normal operation
if (UE_mac_inst[module_idP].PHR_reconfigured == 1) { // upon (re)configuration of the power headroom reporting functionality by upper layers
UE_mac_inst[module_idP].PHR_reporting_active = 1;
UE_mac_inst[module_idP].PHR_reconfigured = 0;
} else {
//LOG_D(MAC,"PHR normal operation %d active %d \n", UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF, UE_mac_inst[module_idP].PHR_reporting_active);
if ((UE_mac_inst[module_idP].scheduling_info.prohibitPHR_SF <= 0) &&
((mac_xface->get_PL(module_idP,0,eNB_indexP) < UE_mac_inst[module_idP].scheduling_info.PathlossChange_db) ||
(UE_mac_inst[module_idP].power_backoff_db[eNB_indexP] > UE_mac_inst[module_idP].scheduling_info.PathlossChange_db)))
// trigger PHR and reset the timer later when the PHR report is sent
UE_mac_inst[module_idP].PHR_reporting_active = 1;
else if (UE_mac_inst[module_idP].PHR_reporting_active ==0 )
UE_mac_inst[module_idP].scheduling_info.prohibitPHR_SF--;
if (UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF <= 0 )
// trigger PHR and reset the timer later when the PHR report is sent
UE_mac_inst[module_idP].PHR_reporting_active = 1;
else if (UE_mac_inst[module_idP].PHR_reporting_active == 0 )
UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF--;
}
if (UE_mac_inst[module_idP].PHR_reconfigured == 1) { // upon (re)configuration of the power headroom reporting functionality by upper layers
UE_mac_inst[module_idP].PHR_reporting_active = 1;
UE_mac_inst[module_idP].PHR_reconfigured = 0;
} else {
//LOG_D(MAC,"PHR normal operation %d active %d \n", UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF, UE_mac_inst[module_idP].PHR_reporting_active);
if ((UE_mac_inst[module_idP].scheduling_info.prohibitPHR_SF <= 0) &&
((mac_xface->get_PL(module_idP,0,eNB_indexP) < UE_mac_inst[module_idP].scheduling_info.PathlossChange_db) ||
(UE_mac_inst[module_idP].power_backoff_db[eNB_indexP] > UE_mac_inst[module_idP].scheduling_info.PathlossChange_db)))
// trigger PHR and reset the timer later when the PHR report is sent
UE_mac_inst[module_idP].PHR_reporting_active = 1;
else if (UE_mac_inst[module_idP].PHR_reporting_active ==0 )
UE_mac_inst[module_idP].scheduling_info.prohibitPHR_SF--;
if (UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF <= 0 )
// trigger PHR and reset the timer later when the PHR report is sent
UE_mac_inst[module_idP].PHR_reporting_active = 1;
else if (UE_mac_inst[module_idP].PHR_reporting_active == 0 )
UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF--;
}
} else { // release / nothing
UE_mac_inst[module_idP].PHR_reporting_active = 0; // release PHR
UE_mac_inst[module_idP].PHR_reporting_active = 0; // release PHR
}
//If the UE has UL resources allocated for new transmission for this TTI here:
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT);
......
......@@ -52,7 +52,9 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP)
//LOG_D(RLC,"RLC_AM_SDU_CONTROL_BUFFER_SIZE %d sizeof(rlc_am_tx_sdu_management_t) %d \n", RLC_AM_SDU_CONTROL_BUFFER_SIZE, sizeof(rlc_am_tx_sdu_management_t));
rlc_pP->input_sdus = calloc(1, RLC_AM_SDU_CONTROL_BUFFER_SIZE*sizeof(rlc_am_tx_sdu_management_t));
rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
#warning "cast the rlc retrans buffer to uint32"
// rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
rlc_pP->pdu_retrans_buffer = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] input_sdus[] = %p element size=%d\n", frameP, rlc_pP->input_sdus,sizeof(rlc_am_tx_sdu_management_t));
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] pdu_retrans_buffer[] = %p element size=%d\n", frameP, rlc_pP->pdu_retrans_buffer,sizeof(rlc_am_tx_data_pdu_management_t));
......
......@@ -88,7 +88,7 @@ typedef struct
uint8_t* (*get_dlsch_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TB_index);
/// Send ULSCH sdu to MAC for given rnti
void (*rx_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti, uint8_t *sdu,uint16_t sdu_len, int harq_pid);
void (*rx_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti, uint8_t *sdu,uint16_t sdu_len, int harq_pid,uint8_t *msg3_flag);
/// Indicate failure to synch to external source
void (*mrbch_phy_sync_failure) (module_id_t Mod_id,frame_t frameP, uint8_t free_eNB_index);
......@@ -131,6 +131,10 @@ typedef struct
#endif
// configure the cba rnti at the physical layer
void (*phy_config_cba_rnti)(module_id_t Mod_id,eNB_flag_t eNB_flag, uint8_t index, uint16_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
/// get delta mcs for fast UL AMC
// uint8_t eNB_id,uint8_t harq_pid, uint8_t UE_id,
int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
/// UE functions
......
......@@ -1662,6 +1662,10 @@ uint16_t do_RRCConnectionReconfiguration(uint8_t Mod
C_RNTI_t *cba_rnti,
struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList
*dedicatedInfoNASList
#ifdef Rel10
, SCellToAddMod_r10_t *SCell_config
#endif
) {
asn_enc_rval_t enc_rval;
......@@ -2114,7 +2118,7 @@ uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t
return encoded;
}
OAI_UECapability_t *fill_ue_capability() {
OAI_UECapability_t *fill_ue_capability(void) {
static OAI_UECapability_t UECapability; /* TODO declared static to allow returning this has an address should be allocated in a cleaner way. */
SupportedBandEUTRA_t Bandlist[4];
// BandInfoEUTRA_t BandInfo_meas[4];
......
......@@ -190,7 +190,11 @@ uint16_t do_RRCConnectionReconfiguration(uint8_t Mod
RSRP_Range_t *rsrp,
C_RNTI_t *cba_rnti,
struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList
*dedicatedInfoNASList);
*dedicatedInfoNASList
#ifdef Rel10
, SCellToAddMod_r10_t *SCell_config
#endif
);
/***
* \brief Generate an MCCH-Message (eNB). This routine configures MBSFNAreaConfiguration (PMCH-InfoList and Subframe Allocation for MBMS data)
......@@ -218,7 +222,7 @@ uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t trans
uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer);
OAI_UECapability_t *fill_ue_capability();
OAI_UECapability_t *fill_ue_capability(void);
uint8_t do_UECapabilityEnquiry(uint8_t Mod_id,
uint8_t *buffer,
......
......@@ -71,6 +71,7 @@
#ifdef Rel10
#include "MCCH-Message.h"
#include "MBSFNAreaConfiguration-r9.h"
#include "SCellToAddMod-r10.h"
#endif
#include "AS-Config.h"
#include "AS-Context.h"
......@@ -312,6 +313,9 @@ typedef struct eNB_RRC_INST_s {
uint8_t *SIB23;
uint8_t sizeof_SIB23;
uint16_t physCellId;
#ifdef Rel10
SCellToAddMod_r10_t sCell_config[NUMBER_OF_UE_MAX][2];
#endif
BCCH_BCH_Message_t mib;
BCCH_DL_SCH_Message_t siblock1;
BCCH_DL_SCH_Message_t systemInformation;
......
......@@ -537,6 +537,7 @@ void rrc_eNB_free_UE_index(
eNB_rrc_inst[enb_mod_idP].Info.UE_list[ue_mod_idP]);
eNB_rrc_inst[enb_mod_idP].Info.UE[ue_mod_idP].Status = RRC_IDLE;
eNB_rrc_inst[enb_mod_idP].Info.UE_list[ue_mod_idP] = 0;
free(eNB_rrc_inst[enb_mod_idP].SRB_configList[ue_mod_idP]);
}
/*------------------------------------------------------------------------------*/
......@@ -1156,7 +1157,11 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration(
#else
physicalConfigDedicated[ue_mod_idP], MeasObj_list, ReportConfig_list, quantityConfig, MeasId_list,
#endif
mac_MainConfig, NULL, NULL, Sparams, rsrp, cba_RNTI, dedicatedInfoNASList);
mac_MainConfig, NULL, NULL, Sparams, rsrp, cba_RNTI, dedicatedInfoNASList
#ifdef Rel10
, NULL //SCellToAddMod_r10_t
#endif
);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"[MSG] RRC Connection Reconfiguration\n");
......@@ -1199,8 +1204,9 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_SCell(module_id_t enb_mod_idP,
uint8_t sCellIndexToAdd = 0; //one SCell so far
// uint8_t sCellIndexToAdd;
// sCellIndexToAdd = rrc_find_free_SCell_index(enb_mod_idP, ue_mod_idP, 1);
if (eNB_rrc_inst[enb_mod_idP].sCell_config[ue_mod_idP][sCellIndexToAdd]) {
eNB_rrc_inst[enb_mod_idP].sCell_config[ue_mod_idP][sCellIndexToAdd]->cellIdentification_r10->dl_CarrierFreq_r10 = dl_CarrierFreq_r10;
// if (eNB_rrc_inst[enb_mod_idP].sCell_config[ue_mod_idP][sCellIndexToAdd] ) {
if (eNB_rrc_inst[enb_mod_idP].sCell_config != NULL) {
eNB_rrc_inst[enb_mod_idP].sCell_config[ue_mod_idP][sCellIndexToAdd].cellIdentification_r10->dl_CarrierFreq_r10 = dl_CarrierFreq_r10;
}
else {
LOG_E(RRC,"Scell not configured!\n");
......@@ -1210,15 +1216,12 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_SCell(module_id_t enb_mod_idP,
size = do_RRCConnectionReconfiguration(enb_mod_idP,
buffer,
ue_mod_idP,
/*0*/rrc_eNB_get_next_transaction_identifier(enb_mod_idP),//Transaction_id,
rrc_eNB_get_next_transaction_identifier(enb_mod_idP),//Transaction_id,
(SRB_ToAddModList_t*)NULL,
(DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL,
(struct SPS_Config*)NULL,
(struct PhysicalConfigDedicated*)NULL,
#ifdef Rel10
eNB_rrc_inst[enb_mod_idP].sCell_config[ue_mod_idP][sCellIndexToAdd],
#endif
(MeasObjectToAddModList_t*)NULL,
(ReportConfigToAddModList_t*)NULL,
(QuantityConfig_t*)NULL,
......@@ -1229,7 +1232,12 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_SCell(module_id_t enb_mod_idP,
(struct MeasConfig__speedStatePars*)NULL,
(RSRP_Range_t*)NULL,
(C_RNTI_t*)NULL,
(struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList*)NULL);
(struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList*)NULL
#ifdef Rel10
, eNB_rrc_inst[enb_mod_idP].sCell_config
#endif
);
LOG_I(RRC,"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCConnectionReconfiguration (bytes %d, UE id %d)\n",
enb_mod_idP,frame, size, ue_mod_idP);
......@@ -2206,7 +2214,11 @@ void rrc_eNB_generate_RRCConnectionReconfiguration_handover(
NULL, //*sps_Config,
physicalConfigDedicated[ue_mod_idP], MeasObj_list, ReportConfig_list, NULL, //quantityConfig,
MeasId_list, mac_MainConfig, NULL, mobilityInfo, Sparams,
NULL, NULL, dedicatedInfoNASList);
NULL, NULL, dedicatedInfoNASList
#ifdef Rel10
, NULL // SCellToAddMod_r10_t
#endif
);
LOG_I(RRC,
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCConnectionReconfiguration for handover (bytes %d, UE id %d)\n",
......
......@@ -146,7 +146,7 @@ void average_pkt_jitter(int src, int dst, int application){
otg_info->rx_jitter_avg[src][dst][application]/= otg_info->rx_jitter_sample[src][dst][application];
otg_info->rx_jitter_avg_e2e[src][dst][application]/= otg_info->rx_jitter_sample[src][dst][application];
} else {
LOG_W(OTG,"[src %d][dst %d][app %d]number of samples for jitter calculation is %d\n",src, dst, application, otg_info->rx_jitter_sample[src][dst][application]);
LOG_T(OTG,"[src %d][dst %d][app %d]number of samples for jitter calculation is %d\n",src, dst, application, otg_info->rx_jitter_sample[src][dst][application]);
}
if (otg_info->rx_jitter_avg[src][dst][application] > 0) {
......@@ -239,7 +239,7 @@ void kpi_gen() {
int num_active_source=0;
int dl_ok=0,ul_ok;
int dl_ok=0,ul_ok=0;
char traffic_type[12];
char traffic[30];
......@@ -849,9 +849,9 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
}
if ((dl_ok == 1 ) && (ul_ok ==1))
LOG_I(OTG,"************ DL and UL loss rate below 10% *************\n");
LOG_I(OTG,"************ DL and UL loss rate below 10 *************\n");
else
LOG_I(OTG,"************ DL and UL loss rate above 10% *************\n");
LOG_I(OTG,"************ DL and UL loss rate above 10 *************\n");
#endif
}
......
......@@ -407,15 +407,15 @@ int check_data_transmit(int src,int dst, int app, int ctime){
// do not generate packet for this pair of src, dst : no app type and/or no idt are defined
if (g_otg->flow_start[src][dst][app] > ctime ){
//g_ otg->flow_start_flag[src][dst][app]=1;
LOG_D(OTG,"Flow start time not reached : do not generate packet for this pair of src=%d, dst =%d, start %d < ctime %d \n",
LOG_T(OTG,"Flow start time not reached : do not generate packet for this pair of src=%d, dst =%d, start %d < ctime %d \n",
src, dst,g_otg->flow_start[src][dst][app], ctime);
size+=0;
}else if (g_otg->flow_duration[src][dst][app] + g_otg->flow_start[src][dst][app] < ctime ){
LOG_D(OTG,"Flow duration reached: do not generate packet for this pair of src=%d, dst =%d, duration %d < ctime %d + start %d\n",
LOG_T(OTG,"Flow duration reached: do not generate packet for this pair of src=%d, dst =%d, duration %d < ctime %d + start %d\n",
src, dst,g_otg->flow_duration[src][dst][app], ctime, g_otg->flow_start[src][dst][app]);
size+=0;
}else if ((g_otg->application_type[src][dst][app]==0)&&(g_otg->idt_dist[src][dst][app][PE_STATE]==0)){
LOG_D(OTG,"Do not generate packet for this pair of src=%d, dst =%d, IDT zero and app %d not specificed\n", src, dst, app);
LOG_T(OTG,"Do not generate packet for this pair of src=%d, dst =%d, IDT zero and app %d not specificed\n", src, dst, app);
size+=0;
}
......@@ -835,11 +835,11 @@ int k;
g_otg->trans_proto[i][j][k] = UDP;
g_otg->ip_v[i][j][k] = IPV4;
g_otg->idt_dist[i][j][k][PE_STATE] = FIXED;
g_otg->idt_min[i][j][k][PE_STATE] = (int)round(uniform_dist((i+1)*30,(i+1)*100));// 500+(i+1)*10; //random idt among different UEs
g_otg->idt_max[i][j][k][PE_STATE] = 10;
g_otg->idt_min[i][j][k][PE_STATE] = 20;//(int)round(uniform_dist((i+1)*30,(i+1)*100));// 500+(i+1)*10; //random idt among different UEs
g_otg->idt_max[i][j][k][PE_STATE] = 20;
g_otg->size_dist[i][j][k][PE_STATE] = FIXED;
g_otg->size_min[i][j][k][PE_STATE] = 16;
g_otg->size_max[i][j][k][PE_STATE] = 50;
g_otg->size_min[i][j][k][PE_STATE] = 128;
g_otg->size_max[i][j][k][PE_STATE] = 128;
LOG_I(OTG,"OTG_CONFIG SCBR, src = %d, dst = %d, traffic id %d, idt %d dist type for size = %d\n", i, j, k,
g_otg->idt_min[i][j][k][PE_STATE], g_otg->size_min[i][j][k][PE_STATE]);
#ifdef STANDALONE
......@@ -851,11 +851,11 @@ int k;
g_otg->trans_proto[i][j][k] = UDP;
g_otg->ip_v[i][j][k] = IPV4;
g_otg->idt_dist[i][j][k][PE_STATE] = FIXED;
g_otg->idt_min[i][j][k][PE_STATE] = (int)round(uniform_dist((i+1)*30, (i+1)*100));// 250+(i+1)*10;
g_otg->idt_max[i][j][k][PE_STATE] = 10;
g_otg->idt_min[i][j][k][PE_STATE] = 20;//(int)round(uniform_dist((i+1)*30, (i+1)*100));// 250+(i+1)*10;
g_otg->idt_max[i][j][k][PE_STATE] = 20;
g_otg->size_dist[i][j][k][PE_STATE] = FIXED;
g_otg->size_min[i][j][k][PE_STATE] = 32;
g_otg->size_max[i][j][k][PE_STATE] = 512;
g_otg->size_min[i][j][k][PE_STATE] = 768;
g_otg->size_max[i][j][k][PE_STATE] = 768;
LOG_I(OTG,"OTG_CONFIG MCBR, src = %d, dst = %d, traffic id %d, dist type for size = %d\n", i, j,k , g_otg->size_dist[i][j][k][PE_STATE]);
#ifdef STANDALONE
g_otg->dst_port[i][j] = 302;
......@@ -866,11 +866,11 @@ int k;
g_otg->trans_proto[i][j][k] = UDP;
g_otg->ip_v[i][j][k] = IPV4;
g_otg->idt_dist[i][j][k][PE_STATE] = FIXED;// main param in this mode
g_otg->idt_min[i][j][k][PE_STATE] = (int)round(uniform_dist((i+1)*30,(i+1)*100)); //125+(i+1)*10;
g_otg->idt_max[i][j][k][PE_STATE] = 10;
g_otg->idt_min[i][j][k][PE_STATE] = 20;// (int)round(uniform_dist((i+1)*30,(i+1)*100)); //125+(i+1)*10;
g_otg->idt_max[i][j][k][PE_STATE] = 20;
g_otg->size_dist[i][j][k][PE_STATE] = FIXED; // main param in this mode
g_otg->size_min[i][j][k][PE_STATE] = 128;// main param in this mode
g_otg->size_max[i][j][k][PE_STATE] = 1024;
g_otg->size_min[i][j][k][PE_STATE] = 1400;// main param in this mode
g_otg->size_max[i][j][k][PE_STATE] = 1400;
LOG_I(OTG,"OTG_CONFIG BCBR, src = %d, dst = %d, dist type for size = %d\n", i, j, g_otg->size_dist[i][j][k][PE_STATE]);
#ifdef STANDALONE
g_otg->dst_port[i][j] = 302;
......
......@@ -4,7 +4,7 @@
<LARGE_SCALE>urban</LARGE_SCALE>
<FREE_SPACE_MODEL_PARAMETERS>
<PATHLOSS_EXPONENT>2</PATHLOSS_EXPONENT>
<PATHLOSS_0_dB>-50</PATHLOSS_0_dB><!--pathloss at 1km -->
<PATHLOSS_0_dB>-108</PATHLOSS_0_dB><!--pathloss at 1km -->
</FREE_SPACE_MODEL_PARAMETERS>
<SMALL_SCALE>AWGN</SMALL_SCALE>
</FADING>
......@@ -62,8 +62,8 @@
<PREDEFINED_TRAFFIC>
<SOURCE_ID>1</SOURCE_ID> <!-- valid formats are "n:m" and "n,m" and "n" -->
<FLOW_START_ms>200</FLOW_START_ms> <!-- indicates the start time of the app or the actual duration of the traffic-->
<FLOW_DURATION_ms>500</FLOW_DURATION_ms>
<APPLICATION_TYPE>scbr</APPLICATION_TYPE>
<FLOW_DURATION_ms>600</FLOW_DURATION_ms>
<APPLICATION_TYPE>bcbr</APPLICATION_TYPE>
<DESTINATION_ID>0</DESTINATION_ID> <!-- valid formats are "n:m" and "n,m" and "n" -->
</PREDEFINED_TRAFFIC>
</APPLICATION_CONFIG>
......
......@@ -17,7 +17,7 @@
<MOBILITY>
<UE_MOBILITY>
<RANDOM_UE_DISTRIBUTION>
<NUMBER_OF_NODES>4</NUMBER_OF_NODES>
<NUMBER_OF_NODES>9</NUMBER_OF_NODES>
</RANDOM_UE_DISTRIBUTION>
<UE_MOBILITY_TYPE>STATIC</UE_MOBILITY_TYPE> <!-- STATIC -->
</UE_MOBILITY>
......@@ -37,7 +37,7 @@
<SOURCE_ID>0</SOURCE_ID>
<TRANSPORT_PROTOCOL>udp</TRANSPORT_PROTOCOL> <!-- OPTIONS: tcp (default), udp -->
<IP_VERSION>ipv6</IP_VERSION> <!-- OPTIONS: ipv4 (default), ipv6 -->
<DESTINATION_ID>1:3</DESTINATION_ID>
<DESTINATION_ID>1:9</DESTINATION_ID>
<FLOW_START_ms>1000</FLOW_START_ms> <!-- indicates the start time of the app or the actual duration of the traffic-->
<FLOW_DURATION_ms>10000</FLOW_DURATION_ms> <!-- indicates the start time of the app or the actual duration of the traffic-->
......@@ -51,7 +51,7 @@
</CUSTOMIZED_TRAFFIC>
<CUSTOMIZED_TRAFFIC>
<SOURCE_ID>1:3</SOURCE_ID>
<SOURCE_ID>1:9</SOURCE_ID>
<TRANSPORT_PROTOCOL>udp</TRANSPORT_PROTOCOL> <!-- OPTIONS: tcp (default), udp -->
<IP_VERSION>ipv6</IP_VERSION> <!-- OPTIONS: ipv4 (default), ipv6 -->
<DESTINATION_ID>0</DESTINATION_ID>
......
......@@ -71,7 +71,7 @@
#include "oaisim.h"
#define RF
#define DEBUG_SIM
//#define DEBUG_SIM
int number_rb_ul;
int first_rbUL ;
......@@ -284,7 +284,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
#ifdef DEBUG_SIM
for (i=0;i<eNB2UE[eNB_id][UE_id][CC_id]->channel_length;i++)
printf("ch(%d,%d)[%d] : (%f,%f)\n",eNB_id,UE_id,i,eNB2UE[eNB_id][UE_id][CC_id]->ch[0][i].x,eNB2UE[eNB_id][UE_id][CC_id]->ch[0][i].y);
LOG_D(OCM,"channel(%d,%d)[%d] : (%f,%f)\n",eNB_id,UE_id,i,eNB2UE[eNB_id][UE_id][CC_id]->ch[0][i].x,eNB2UE[eNB_id][UE_id][CC_id]->ch[0][i].y);
#endif
LOG_D(OCM,"[SIM][DL] Channel eNB %d => UE %d (CCid %d): tx_power %f dBm/RE, path_loss %f dB\n",
......
......@@ -573,7 +573,7 @@ int ocg_config_env(void) {
oai_emulation.info.frame_type[CC_id]=TDD;
}
else
LOG_I(EMU,"Frame type is %s \n",oai_emulation.info.frame_type_name);
LOG_I(EMU,"Frame type is %s \n",oai_emulation.info.frame_type_name[CC_id]);
if (oai_emulation.info.frame_type[CC_id] == TDD ){
if ((oai_emulation.info.tdd_config[CC_id] > 6) || (oai_emulation.info.tdd_config[CC_id] < 0)) {
LOG_E(EMU,"TDD config %d out of range, set it to 3\n",oai_emulation.info.tdd_config[CC_id]);
......
......@@ -105,7 +105,7 @@ double forgetting_factor = 0.0;
uint8_t beta_ACK = 0;
uint8_t beta_RI = 0;
uint8_t beta_CQI = 2;
uint8_t target_ul_mcs = 4;
uint8_t target_ul_mcs = 16;
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
int map1,map2;
double **ShaF = NULL;
......@@ -883,7 +883,7 @@ void init_openair2(void) {
module_id_t enb_id;
module_id_t UE_id;
int CC_id;
#warning "eNB index is hard coded to zero"
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
l2_init (&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
oai_emulation.info.eMBMS_active_state,
......
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