Commit ca086cd2 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Merge remote-tracking branch 'origin/develop-SRS-MIMO' into develop-SRS-feedback

# Conflicts:
#	openair1/SCHED_NR/phy_procedures_nr_gNB.c
parents 7e707eff 93f941ec
...@@ -197,8 +197,8 @@ check_warnings() { ...@@ -197,8 +197,8 @@ check_warnings() {
#argument: #argument:
# $1: log file # $1: log file
check_errors() { check_errors() {
#we look for 'warning:' in the compilation log file #we look for 'error:' in the compilation log file
error_count=`grep "error:" "$1" | wc -l` error_count=`grep -c "error:" "$1"`
if [ $error_count -gt 0 ]; then if [ $error_count -gt 0 ]; then
echo_error "ERROR: $error_count error. See $1" echo_error "ERROR: $error_count error. See $1"
fi fi
......
...@@ -466,7 +466,7 @@ void init_gNB_Tpool(int inst) { ...@@ -466,7 +466,7 @@ void init_gNB_Tpool(int inst) {
pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning
} }
if (!get_softmodem_params()->emulate_l1) if ((!get_softmodem_params()->emulate_l1) && (!IS_SOFTMODEM_NOSTATS_BIT))
threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW); threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW);
threadCreate(&proc->pthread_tx_reorder, tx_reorder_thread, (void *)gNB, "thread_tx_reorder", -1, OAI_PRIORITY_RT_MAX); threadCreate(&proc->pthread_tx_reorder, tx_reorder_thread, (void *)gNB, "thread_tx_reorder", -1, OAI_PRIORITY_RT_MAX);
......
...@@ -1109,8 +1109,10 @@ void init_NR_UE_threads(int nb_inst) { ...@@ -1109,8 +1109,10 @@ void init_NR_UE_threads(int nb_inst) {
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
threadCreate(&threads[inst], UE_thread, (void *)UE, "UEthread", -1, OAI_PRIORITY_RT_MAX); threadCreate(&threads[inst], UE_thread, (void *)UE, "UEthread", -1, OAI_PRIORITY_RT_MAX);
pthread_t stat_pthread; if (!IS_SOFTMODEM_NOSTATS_BIT) {
threadCreate(&stat_pthread, nrL1_UE_stats_thread, UE, "L1_UE_stats", -1, OAI_PRIORITY_RT_LOW); pthread_t stat_pthread;
threadCreate(&stat_pthread, nrL1_UE_stats_thread, UE, "L1_UE_stats", -1, OAI_PRIORITY_RT_LOW);
}
} }
} }
......
...@@ -85,6 +85,7 @@ char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr) { ...@@ -85,6 +85,7 @@ char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr) {
} }
void get_common_options(uint32_t execmask) { void get_common_options(uint32_t execmask) {
int32_t stats_disabled = 0;
uint32_t online_log_messages=0; uint32_t online_log_messages=0;
uint32_t glog_level=0 ; uint32_t glog_level=0 ;
uint32_t start_telnetsrv = 0, start_telnetclt = 0; uint32_t start_telnetsrv = 0, start_telnetclt = 0;
...@@ -149,6 +150,8 @@ void get_common_options(uint32_t execmask) { ...@@ -149,6 +150,8 @@ void get_common_options(uint32_t execmask) {
if(worker_config != NULL) set_worker_conf(worker_config); if(worker_config != NULL) set_worker_conf(worker_config);
nfapi_setmode(nfapi_mode); nfapi_setmode(nfapi_mode);
if (stats_disabled)
set_softmodem_optmask(SOFTMODEM_NOSTATS_BIT);
} }
void softmodem_printresources(int sig, telnet_printfunc_t pf) { void softmodem_printresources(int sig, telnet_printfunc_t pf) {
struct rusage usage; struct rusage usage;
......
...@@ -101,6 +101,7 @@ extern "C" ...@@ -101,6 +101,7 @@ extern "C"
#define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR\n" #define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR\n"
#define CONFIG_L1_EMULATOR "Run in L1 emulated mode (disable PHY layer)\n" #define CONFIG_L1_EMULATOR "Run in L1 emulated mode (disable PHY layer)\n"
#define CONFIG_HLP_CONTINUOUS_TX "perform continuous transmission, even in TDD mode (to work around USRP issues)\n" #define CONFIG_HLP_CONTINUOUS_TX "perform continuous transmission, even in TDD mode (to work around USRP issues)\n"
#define CONFIG_HLP_STATS_DISABLE "disable globally the stats generation and persistence"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */ /* command line parameters common to eNodeB and UE */
...@@ -171,6 +172,7 @@ extern int usrp_tx_thread; ...@@ -171,6 +172,7 @@ extern int usrp_tx_thread;
{"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \ {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \
{"emulate-l1", CONFIG_L1_EMULATOR, PARAMFLAG_BOOL, iptr:&EMULATE_L1, defintval:0, TYPE_INT, 0}, \ {"emulate-l1", CONFIG_L1_EMULATOR, PARAMFLAG_BOOL, iptr:&EMULATE_L1, defintval:0, TYPE_INT, 0}, \
{"continuous-tx", CONFIG_HLP_CONTINUOUS_TX,PARAMFLAG_BOOL, iptr:&CONTINUOUS_TX, defintval:0, TYPE_INT, 0}, \ {"continuous-tx", CONFIG_HLP_CONTINUOUS_TX,PARAMFLAG_BOOL, iptr:&CONTINUOUS_TX, defintval:0, TYPE_INT, 0}, \
{"disable-stats", CONFIG_HLP_STATS_DISABLE, PARAMFLAG_BOOL, iptr:&stats_disabled, defintval:0, TYPE_INT, 0}, \
} }
#define CONFIG_HLP_NSA "Enable NSA mode \n" #define CONFIG_HLP_NSA "Enable NSA mode \n"
...@@ -217,6 +219,7 @@ extern int usrp_tx_thread; ...@@ -217,6 +219,7 @@ extern int usrp_tx_thread;
#define SOFTMODEM_GNB_BIT (1<<21) #define SOFTMODEM_GNB_BIT (1<<21)
#define SOFTMODEM_4GUE_BIT (1<<22) #define SOFTMODEM_4GUE_BIT (1<<22)
#define SOFTMODEM_5GUE_BIT (1<<23) #define SOFTMODEM_5GUE_BIT (1<<23)
#define SOFTMODEM_NOSTATS_BIT (1<<24)
#define SOFTMODEM_FUNC_BITS (SOFTMODEM_ENB_BIT | SOFTMODEM_GNB_BIT | SOFTMODEM_5GUE_BIT | SOFTMODEM_4GUE_BIT) #define SOFTMODEM_FUNC_BITS (SOFTMODEM_ENB_BIT | SOFTMODEM_GNB_BIT | SOFTMODEM_5GUE_BIT | SOFTMODEM_4GUE_BIT)
#define MAPPING_SOFTMODEM_FUNCTIONS {{"enb",SOFTMODEM_ENB_BIT},{"gnb",SOFTMODEM_GNB_BIT},{"4Gue",SOFTMODEM_4GUE_BIT},{"5Gue",SOFTMODEM_5GUE_BIT}} #define MAPPING_SOFTMODEM_FUNCTIONS {{"enb",SOFTMODEM_ENB_BIT},{"gnb",SOFTMODEM_GNB_BIT},{"4Gue",SOFTMODEM_4GUE_BIT},{"5Gue",SOFTMODEM_5GUE_BIT}}
...@@ -234,6 +237,7 @@ extern int usrp_tx_thread; ...@@ -234,6 +237,7 @@ extern int usrp_tx_thread;
#define IS_SOFTMODEM_GNB_BIT ( get_softmodem_optmask() & SOFTMODEM_GNB_BIT) #define IS_SOFTMODEM_GNB_BIT ( get_softmodem_optmask() & SOFTMODEM_GNB_BIT)
#define IS_SOFTMODEM_4GUE_BIT ( get_softmodem_optmask() & SOFTMODEM_4GUE_BIT) #define IS_SOFTMODEM_4GUE_BIT ( get_softmodem_optmask() & SOFTMODEM_4GUE_BIT)
#define IS_SOFTMODEM_5GUE_BIT ( get_softmodem_optmask() & SOFTMODEM_5GUE_BIT) #define IS_SOFTMODEM_5GUE_BIT ( get_softmodem_optmask() & SOFTMODEM_5GUE_BIT)
#define IS_SOFTMODEM_NOSTATS_BIT ( get_softmodem_optmask() & SOFTMODEM_NOSTATS_BIT)
typedef struct { typedef struct {
uint64_t optmask; uint64_t optmask;
......
...@@ -217,7 +217,7 @@ void oai_create_enb(void) { ...@@ -217,7 +217,7 @@ void oai_create_enb(void) {
} }
// This will cause phy_config_request to be installed. That will result in RRC configuring the PHY // This will cause phy_config_request to be installed. That will result in RRC configuring the PHY
// that will result in eNB->configured being set to TRUE. // that will result in eNB->configured being set to true.
// See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values // See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values
if (RC.eNB[0][0]->if_inst==0 || RC.eNB[0][0]->if_inst->PHY_config_req==0 || RC.eNB[0][0]->if_inst->schedule_response==0) { if (RC.eNB[0][0]->if_inst==0 || RC.eNB[0][0]->if_inst->PHY_config_req==0 || RC.eNB[0][0]->if_inst->schedule_response==0) {
NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.eNB[0][0]->if_inst->PHY_config_req is not installed - install it\n"); NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.eNB[0][0]->if_inst->PHY_config_req is not installed - install it\n");
...@@ -267,7 +267,7 @@ void oai_create_gnb(void) { ...@@ -267,7 +267,7 @@ void oai_create_gnb(void) {
// This will cause phy_config_request to be installed. That will result in RRC configuring the PHY // This will cause phy_config_request to be installed. That will result in RRC configuring the PHY
// that will result in gNB->configured being set to TRUE. // that will result in gNB->configured being set to true.
// See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values // See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values
if (RC.gNB[0]->if_inst==0 || RC.gNB[0]->if_inst->NR_PHY_config_req==0 || RC.gNB[0]->if_inst->NR_Schedule_response==0) { if (RC.gNB[0]->if_inst==0 || RC.gNB[0]->if_inst->NR_PHY_config_req==0 || RC.gNB[0]->if_inst->NR_Schedule_response==0) {
NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.gNB[0][0]->if_inst->NR_PHY_config_req is not installed - install it\n"); NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.gNB[0][0]->if_inst->NR_PHY_config_req is not installed - install it\n");
......
...@@ -613,30 +613,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -613,30 +613,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
for (int id=0; id<NUMBER_OF_NR_SRS_MAX; id++) { for (int id=0; id<NUMBER_OF_NR_SRS_MAX; id++) {
gNB->nr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); gNB->nr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
gNB->nr_srs_info[id]->k_0_p = (uint8_t**)malloc16_clear(MAX_NUM_NR_SRS_AP*sizeof(uint8_t*));
gNB->nr_srs_info[id]->srs_generated_signal = (int32_t**)malloc16_clear(MAX_NUM_NR_SRS_AP*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_generated_signal = (int32_t**)malloc16_clear(MAX_NUM_NR_SRS_AP*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t ***)malloc16(Prx*sizeof(int32_t**));
gNB->nr_srs_info[id]->srs_estimated_channel_freq = (int32_t ***)malloc16(Prx*sizeof(int32_t**));
gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t ***)malloc16(Prx*sizeof(int32_t**));
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted = (int32_t ***)malloc16(Prx*sizeof(int32_t**));
for(i=0; i<MAX_NUM_NR_SRS_AP;i++) { for(i=0; i<MAX_NUM_NR_SRS_AP;i++) {
gNB->nr_srs_info[id]->k_0_p[i] = (uint8_t*)malloc16_clear(MAX_NUM_NR_SRS_SYMBOLS*sizeof(uint8_t));
gNB->nr_srs_info[id]->srs_generated_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_generated_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
} }
for (i=0;i<Prx;i++) {
gNB->nr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t**)malloc16_clear(MAX_NUM_NR_SRS_AP*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t**)malloc16_clear(MAX_NUM_NR_SRS_AP*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t**)malloc16_clear(MAX_NUM_NR_SRS_AP*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t**)malloc16_clear(MAX_NUM_NR_SRS_AP*sizeof(int32_t*));
for (int j = 0; j < MAX_NUM_NR_SRS_AP; j++) {
gNB->nr_srs_info[id]->srs_ls_estimated_channel[i][j] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_freq[i][j] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_time[i][j] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i][j] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
}
}
} }
generate_ul_reference_signal_sequences(SHRT_MAX); generate_ul_reference_signal_sequences(SHRT_MAX);
...@@ -794,30 +774,10 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -794,30 +774,10 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(gNB->nr_csi_rs_info); free_and_zero(gNB->nr_csi_rs_info);
for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) { for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) {
for (int i = 0; i < Prx; i++) { for(int i=0; i<MAX_NUM_NR_SRS_AP; i++) {
for (int j = 0; j < MAX_NUM_NR_SRS_AP; j++) {
free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel[i][j]);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq[i][j]);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i][j]);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i][j]);
}
free_and_zero(gNB->nr_srs_info[id]->srs_received_signal[i]);
free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel[i]);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq[i]);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i]);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i]);
}
for (int i = 0; i < MAX_NUM_NR_SRS_AP; i++) {
free_and_zero(gNB->nr_srs_info[id]->k_0_p[i]);
free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal[i]); free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal[i]);
} }
free_and_zero(gNB->nr_srs_info[id]->k_0_p);
free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal); free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal);
free_and_zero(gNB->nr_srs_info[id]->srs_received_signal);
free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted);
free_and_zero(gNB->nr_srs_info[id]); free_and_zero(gNB->nr_srs_info[id]);
} }
......
...@@ -377,10 +377,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -377,10 +377,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
} }
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
ue->nr_srs_info->k_0_p = (uint8_t**)malloc16_clear(fp->nb_antennas_rx*sizeof(uint8_t*));
for (i=0; i<fp->nb_antennas_rx; i++) {
ue->nr_srs_info->k_0_p[i] = (uint8_t*)malloc16_clear(MAX_NUM_NR_SRS_SYMBOLS*sizeof(uint8_t));
}
// RACH // RACH
prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
...@@ -507,10 +503,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -507,10 +503,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq); free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq);
free_and_zero(ue->nr_csi_rs_info); free_and_zero(ue->nr_csi_rs_info);
for (int i = 0; i < fp->nb_antennas_rx; i++) {
free_and_zero(ue->nr_srs_info->k_0_p[i]);
}
free_and_zero(ue->nr_srs_info->k_0_p);
free_and_zero(ue->nr_srs_info); free_and_zero(ue->nr_srs_info);
free_and_zero(ue->csiim_vars[gNB_id]); free_and_zero(ue->csiim_vars[gNB_id]);
......
...@@ -41,10 +41,10 @@ extern int16_t *ul_ref_sigs_rx[30][2][34]; ...@@ -41,10 +41,10 @@ extern int16_t *ul_ref_sigs_rx[30][2][34];
int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
L1_rxtx_proc_t *proc, L1_rxtx_proc_t *proc,
LTE_eNB_ULSCH_t * ulsch, LTE_eNB_ULSCH_t * ulsch,
int32_t **ul_ch_estimates, int32_t **ul_ch_estimates,
int32_t **ul_ch_estimates_time, int32_t **ul_ch_estimates_time,
int32_t **rxdataF_ext, int32_t **rxdataF_ext,
module_id_t UE_id, module_id_t UE_id,
unsigned char l, unsigned char l,
unsigned char Ns) { unsigned char Ns) {
...@@ -88,7 +88,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -88,7 +88,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
} }
uint16_t N_rb_alloc = ulsch->harq_processes[harq_pid]->nb_rb; uint16_t N_rb_alloc = ulsch->harq_processes[harq_pid]->nb_rb;
int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(16))); int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(32)));
Msc_RS = N_rb_alloc*12; Msc_RS = N_rb_alloc*12;
cyclic_shift = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + cyclic_shift = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
ulsch->harq_processes[harq_pid]->n_DMRS2 + ulsch->harq_processes[harq_pid]->n_DMRS2 +
...@@ -334,14 +334,14 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -334,14 +334,14 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
current_phase2 = cmin(abs(current_phase2),127); current_phase2 = cmin(abs(current_phase2),127);
// msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]); // msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]);
// rotate channel estimates by estimated phase // rotate channel estimates by estimated phase
rotate_cpx_vector((int16_t *) ul_ch1, rotate_cpx_vector((c16_t *) ul_ch1,
&ru1[2*current_phase1], (c16_t *)&ru1[2*current_phase1],
(int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k], (c16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
Msc_RS, Msc_RS,
15); 15);
rotate_cpx_vector((int16_t *) ul_ch2, rotate_cpx_vector((c16_t *) ul_ch2,
&ru2[2*current_phase2], (c16_t *)&ru2[2*current_phase2],
(int16_t *) &tmp_estimates[0], (c16_t *) tmp_estimates,
Msc_RS, Msc_RS,
15); 15);
// Combine the two rotated estimates // Combine the two rotated estimates
...@@ -657,14 +657,14 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -657,14 +657,14 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
current_phase2 = cmin(abs(current_phase2),127); current_phase2 = cmin(abs(current_phase2),127);
// msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]); // msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]);
// rotate channel estimates by estimated phase // rotate channel estimates by estimated phase
rotate_cpx_vector((int16_t *) ul_ch1, rotate_cpx_vector((c16_t *) ul_ch1,
&ru1[2*current_phase1], (c16_t *) &ru1[2*current_phase1],
(int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k], (c16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
Msc_RS, Msc_RS,
15); 15);
rotate_cpx_vector((int16_t *) ul_ch2, rotate_cpx_vector((c16_t *) ul_ch2,
&ru2[2*current_phase2], (c16_t *) &ru2[2*current_phase2],
(int16_t *) &tmp_estimates[0], (c16_t *) &tmp_estimates[0],
Msc_RS, Msc_RS,
15); 15);
// Combine the two rotated estimates // Combine the two rotated estimates
......
...@@ -1997,7 +1997,7 @@ int get_narrowband_index(int N_RB_UL,int rb) { ...@@ -1997,7 +1997,7 @@ int get_narrowband_index(int N_RB_UL,int rb) {
void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe) { void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe) {
uint8_t harq_pid; uint8_t harq_pid;
//uint8_t UE_id; //uint8_t UE_id;
boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE; const bool new_ulsch = find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST) == -1;
//AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, //AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti); // "No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti);
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
...@@ -2063,7 +2063,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu ...@@ -2063,7 +2063,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) || if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) ||
(ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication) || (ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication) ||
(new_ulsch == TRUE)) { (new_ulsch == true)) {
ulsch->harq_processes[harq_pid]->status = ACTIVE; ulsch->harq_processes[harq_pid]->status = ACTIVE;
ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3; ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3;
ulsch->harq_processes[harq_pid]->Msc_initial = 12*ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks; ulsch->harq_processes[harq_pid]->Msc_initial = 12*ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks;
......
...@@ -509,7 +509,7 @@ typedef struct { ...@@ -509,7 +509,7 @@ typedef struct {
/// Position of first CCE of the dci /// Position of first CCE of the dci
int firstCCE; int firstCCE;
/// flag to indicate that this is a RA response /// flag to indicate that this is a RA response
boolean_t ra_flag; bool ra_flag;
/// rnti /// rnti
rnti_t rnti; rnti_t rnti;
/// Format /// Format
......
...@@ -618,20 +618,20 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) { ...@@ -618,20 +618,20 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) {
double f0 = f[ll]; double f0 = f[ll];
double Ncpm1 = Ncp0; double Ncpm1 = Ncp0;
int16_t *symbol_rotation = fp->symbol_rotation[ll]; c16_t *symbol_rotation = fp->symbol_rotation[ll];
double tl = 0; double tl = 0;
double poff = 2 * M_PI * ((Ncp0 * Tc)) * f0; double poff = 2 * M_PI * ((Ncp0 * Tc)) * f0;
double exp_re = cos(poff); double exp_re = cos(poff);
double exp_im = sin(-poff); double exp_im = sin(-poff);
symbol_rotation[0] = (int16_t)floor(exp_re * 32767); symbol_rotation[0].r = (int16_t)floor(exp_re * 32767);
symbol_rotation[1] = (int16_t)floor(exp_im * 32767); symbol_rotation[0].i = (int16_t)floor(exp_im * 32767);
LOG_I(PHY, "Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb); LOG_I(PHY, "Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb);
LOG_I(PHY, "Symbol rotation %d/%d => (%d,%d)\n", LOG_I(PHY, "Symbol rotation %d/%d => (%d,%d)\n",
0, 0,
nsymb, nsymb,
symbol_rotation[0], symbol_rotation[0].r,
symbol_rotation[1]); symbol_rotation[0].i);
for (int l = 1; l < nsymb; l++) { for (int l = 1; l < nsymb; l++) {
...@@ -646,15 +646,15 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) { ...@@ -646,15 +646,15 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) {
poff = 2 * M_PI * (tl + (Ncp * Tc)) * f0; poff = 2 * M_PI * (tl + (Ncp * Tc)) * f0;
exp_re = cos(poff); exp_re = cos(poff);
exp_im = sin(-poff); exp_im = sin(-poff);
symbol_rotation[l<<1] = (int16_t)floor(exp_re * 32767); symbol_rotation[l].r = (int16_t)floor(exp_re * 32767);
symbol_rotation[1 + (l<<1)] = (int16_t)floor(exp_im * 32767); symbol_rotation[l].i = (int16_t)floor(exp_im * 32767);
LOG_I(PHY, "Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n", LOG_I(PHY, "Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n",
l, l,
nsymb, nsymb,
tl, tl,
symbol_rotation[l<<1], symbol_rotation[l].r,
symbol_rotation[1 + (l<<1)], symbol_rotation[l].i,
(poff / 2 / M_PI) - floor(poff / 2 / M_PI)); (poff / 2 / M_PI) - floor(poff / 2 / M_PI));
Ncpm1 = Ncp; Ncpm1 = Ncp;
...@@ -670,13 +670,13 @@ void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp) ...@@ -670,13 +670,13 @@ void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp)
double poff = -i * 2.0 * M_PI * sample_offset / fp->ofdm_symbol_size; double poff = -i * 2.0 * M_PI * sample_offset / fp->ofdm_symbol_size;
double exp_re = cos(poff); double exp_re = cos(poff);
double exp_im = sin(-poff); double exp_im = sin(-poff);
fp->timeshift_symbol_rotation[i*2] = (int16_t)round(exp_re * 32767); fp->timeshift_symbol_rotation[i].r = (int16_t)round(exp_re * 32767);
fp->timeshift_symbol_rotation[i*2+1] = (int16_t)round(exp_im * 32767); fp->timeshift_symbol_rotation[i].i = (int16_t)round(exp_im * 32767);
if (i < 10) if (i < 10)
LOG_I(PHY,"Timeshift symbol rotation %d => (%d,%d) %f\n",i, LOG_I(PHY,"Timeshift symbol rotation %d => (%d,%d) %f\n",i,
fp->timeshift_symbol_rotation[i*2], fp->timeshift_symbol_rotation[i].r,
fp->timeshift_symbol_rotation[i*2+1], fp->timeshift_symbol_rotation[i].i,
poff); poff);
} }
} }
......
...@@ -46,18 +46,18 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA ...@@ -46,18 +46,18 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
PHY_ofdm_mod(txdataF, // input PHY_ofdm_mod(txdataF, // input
txdata, // output txdata, // output
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
1, // number of symbols 1, // number of symbols
frame_parms->nb_prefix_samples0, // number of prefix samples frame_parms->nb_prefix_samples0, // number of prefix samples
CYCLIC_PREFIX); CYCLIC_PREFIX);
PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size, // input PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size, // input
txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0, // output txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0, // output
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
nsymb-1, nsymb-1,
frame_parms->nb_prefix_samples, // number of prefix samples frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX); CYCLIC_PREFIX);
...@@ -341,14 +341,14 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne ...@@ -341,14 +341,14 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne
} }
void apply_nr_rotation(NR_DL_FRAME_PARMS *fp, void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
int16_t* trxdata, int16_t* trxdata,
int slot, int slot,
int first_symbol, int first_symbol,
int nsymb, int nsymb,
int length) { int length) {
int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot; int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot;
int16_t *symbol_rotation = fp->symbol_rotation[0]; c16_t *symbol_rotation = fp->symbol_rotation[0];
for (int sidx=0;sidx<nsymb;sidx++) { for (int sidx=0;sidx<nsymb;sidx++) {
...@@ -357,14 +357,14 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp, ...@@ -357,14 +357,14 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
slot, slot,
sidx + first_symbol + symb_offset, sidx + first_symbol + symb_offset,
length, length,
symbol_rotation[2 * (sidx + first_symbol + symb_offset)], symbol_rotation[sidx + first_symbol + symb_offset].r,
symbol_rotation[1 + 2 * (sidx + first_symbol + symb_offset)]); symbol_rotation[sidx + first_symbol + symb_offset].i);
rotate_cpx_vector(trxdata + (sidx * length * 2), rotate_cpx_vector(((c16_t*) trxdata) + sidx * length,
&symbol_rotation[2 * (sidx + first_symbol + symb_offset)], symbol_rotation + sidx + first_symbol + symb_offset,
trxdata + (sidx * length * 2), ((c16_t*) trxdata) + sidx * length,
length, length,
15); 15);
} }
} }
...@@ -98,25 +98,25 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, ...@@ -98,25 +98,25 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
stop_meas(&ue->rx_dft_stats); stop_meas(&ue->rx_dft_stats);
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol+symb_offset]; c16_t rot2 = frame_parms->symbol_rotation[0][symbol+symb_offset];
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1]; rot2.i=-rot2.i;
#ifdef DEBUG_FEP #ifdef DEBUG_FEP
// if (ue->frame <100) // if (ue->frame <100)
printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset, printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset,
symbol+symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]); symbol+symb_offset,rot2.r,rot2.i);
#endif #endif
rotate_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
(int16_t*)&rot2, &rot2,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
15); 15);
int16_t *shift_rot = frame_parms->timeshift_symbol_rotation; c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
multadd_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], multadd_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
shift_rot, (int16_t *)shift_rot,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], (int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
1, 1,
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
...@@ -214,18 +214,18 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue, ...@@ -214,18 +214,18 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
stop_meas(&ue->rx_dft_stats); stop_meas(&ue->rx_dft_stats);
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol + symb_offset]; c16_t rot2 = frame_parms->symbol_rotation[0][symbol + symb_offset];
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1]; rot2.i=-rot2.i;
#ifdef DEBUG_FEP #ifdef DEBUG_FEP
// if (ue->frame <100) // if (ue->frame <100)
printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset, printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset,
symbol+symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]); symbol+symb_offset,rot2.r,rot2.i);
#endif #endif
rotate_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
(int16_t*)&rot2, &rot2,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
15); 15);
} }
...@@ -310,19 +310,19 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms, ...@@ -310,19 +310,19 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
for (int symbol=first_symbol;symbol<nsymb;symbol++) { for (int symbol=first_symbol;symbol<nsymb;symbol++) {
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[1])[symbol + symb_offset]; c16_t rot2 = frame_parms->symbol_rotation[1][symbol + symb_offset];
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1]; rot2.i=-rot2.i;
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]); LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,rot2.r,rot2.i);
rotate_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
(int16_t*)&rot2, &rot2,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], (c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
length, length,
15); 15);
int16_t *shift_rot = frame_parms->timeshift_symbol_rotation; c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
shift_rot, (int16_t *)shift_rot,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], (int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
1, 1,
length, length,
......
...@@ -68,15 +68,15 @@ int nr_est_timing_advance_pusch(PHY_VARS_gNB* gNB, int UE_id) ...@@ -68,15 +68,15 @@ int nr_est_timing_advance_pusch(PHY_VARS_gNB* gNB, int UE_id)
} }
int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms, int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
const int32_t **srs_estimated_channel_time) { const int32_t srs_estimated_channel_time[][frame_parms->ofdm_symbol_size]) {
int timing_advance = 0; int timing_advance = 0;
int max_val = 0; int max_val = 0;
for (int i = 0; i < frame_parms->ofdm_symbol_size; i++) { for (int i = 0; i < frame_parms->ofdm_symbol_size; i++) {
int temp = 0; int temp = 0;
for (int aa = 0; aa < frame_parms->nb_antennas_rx; aa++) { for (int aa = 0; aa < frame_parms->nb_antennas_rx; aa++) {
int Re = ((int16_t*)srs_estimated_channel_time[aa])[(i<<1)]; int Re = ((c16_t*)srs_estimated_channel_time[aa])[i].r;
int Im = ((int16_t*)srs_estimated_channel_time[aa])[1+(i<<1)]; int Im = ((c16_t*)srs_estimated_channel_time[aa])[i].i;
temp += (Re*Re/2) + (Im*Im/2); temp += (Re*Re/2) + (Im*Im/2);
} }
if (temp > max_val) { if (temp > max_val) {
......
...@@ -855,7 +855,6 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -855,7 +855,6 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
uint32_t nb_re_pusch) uint32_t nb_re_pusch)
{ {
//#define DEBUG_UL_PTRS 1 //#define DEBUG_UL_PTRS 1
int16_t *phase_per_symbol = NULL;
int32_t *ptrs_re_symbol = NULL; int32_t *ptrs_re_symbol = NULL;
int8_t ret = 0; int8_t ret = 0;
...@@ -872,20 +871,20 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -872,20 +871,20 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
uint8_t *ptrsReOffset = &rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset; uint8_t *ptrsReOffset = &rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset;
/* loop over antennas */ /* loop over antennas */
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
phase_per_symbol = (int16_t*)gNB->pusch_vars[ulsch_id]->ptrs_phase_per_slot[aarx]; c16_t *phase_per_symbol = (c16_t*)gNB->pusch_vars[ulsch_id]->ptrs_phase_per_slot[aarx];
ptrs_re_symbol = &gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot; ptrs_re_symbol = &gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot;
*ptrs_re_symbol = 0; *ptrs_re_symbol = 0;
phase_per_symbol[(2*symbol)+1] = 0; // Imag phase_per_symbol[symbol].i = 0;
/* set DMRS estimates to 0 angle with magnitude 1 */ /* set DMRS estimates to 0 angle with magnitude 1 */
if(is_dmrs_symbol(symbol,*dmrsSymbPos)) { if(is_dmrs_symbol(symbol,*dmrsSymbPos)) {
/* set DMRS real estimation to 32767 */ /* set DMRS real estimation to 32767 */
phase_per_symbol[2*symbol]=(int16_t)((1<<15)-1); // 32767 phase_per_symbol[symbol].r=INT16_MAX; // 32767
#ifdef DEBUG_UL_PTRS #ifdef DEBUG_UL_PTRS
printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[2*symbol],phase_per_symbol[(2*symbol)+1]); printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[symbol].r,phase_per_symbol[symbol].i);
#endif #endif
} }
else {// real ptrs value is set to 0 else {// real ptrs value is set to 0
phase_per_symbol[2*symbol] = 0; // Real phase_per_symbol[symbol].r = 0;
} }
if(symbol == *startSymbIndex) { if(symbol == *startSymbIndex) {
...@@ -910,7 +909,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -910,7 +909,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
symbol,frame_parms->ofdm_symbol_size, symbol,frame_parms->ofdm_symbol_size,
(int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(symbol * nb_re_pusch)], (int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(symbol * nb_re_pusch)],
gNB->nr_gold_pusch_dmrs[rel15_ul->scid][nr_tti_rx][symbol], gNB->nr_gold_pusch_dmrs[rel15_ul->scid][nr_tti_rx][symbol],
&phase_per_symbol[2* symbol], (int16_t*)&phase_per_symbol[symbol],
ptrs_re_symbol); ptrs_re_symbol);
} }
/* For last OFDM symbol at each antenna perform interpolation and compensation for the slot*/ /* For last OFDM symbol at each antenna perform interpolation and compensation for the slot*/
...@@ -920,7 +919,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -920,7 +919,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
/*------------------------------------------------------------------------------------------------------- */ /*------------------------------------------------------------------------------------------------------- */
/* If L-PTRS is > 0 then we need interpolation */ /* If L-PTRS is > 0 then we need interpolation */
if(*L_ptrs > 0) { if(*L_ptrs > 0) {
ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, phase_per_symbol, *startSymbIndex, *nbSymb); ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, (int16_t*)phase_per_symbol, *startSymbIndex, *nbSymb);
if(ret != 0) { if(ret != 0) {
LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n"); LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n");
} }
...@@ -939,11 +938,11 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -939,11 +938,11 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
/* Skip rotation if the slot processing is wrong */ /* Skip rotation if the slot processing is wrong */
if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) { if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) {
#ifdef DEBUG_UL_PTRS #ifdef DEBUG_UL_PTRS
printf("[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[2* i],phase_per_symbol[(2* i) +1]); printf("[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i);
#endif #endif
rotate_cpx_vector((int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)], rotate_cpx_vector((c16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
&phase_per_symbol[2* i], &phase_per_symbol[i],
(int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)], (c16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
((*nb_rb) * NR_NB_SC_PER_RB), 15); ((*nb_rb) * NR_NB_SC_PER_RB), 15);
}// if not DMRS Symbol }// if not DMRS Symbol
}// symbol loop }// symbol loop
...@@ -967,10 +966,11 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB, ...@@ -967,10 +966,11 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
const nfapi_nr_srs_pdu_t *srs_pdu, const nfapi_nr_srs_pdu_t *srs_pdu,
const nr_srs_info_t *nr_srs_info, const nr_srs_info_t *nr_srs_info,
const int32_t **srs_generated_signal, const int32_t **srs_generated_signal,
const int32_t **srs_received_signal, int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
int32_t ***srs_estimated_channel_freq, int32_t srs_ls_estimated_channel[][MAX_NUM_NR_SRS_AP][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
int32_t ***srs_estimated_channel_time, int32_t srs_estimated_channel_freq[][MAX_NUM_NR_SRS_AP][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
int32_t ***srs_estimated_channel_time_shifted, int32_t srs_estimated_channel_time[][MAX_NUM_NR_SRS_AP][gNB->frame_parms.ofdm_symbol_size],
int32_t srs_estimated_channel_time_shifted[][MAX_NUM_NR_SRS_AP][gNB->frame_parms.ofdm_symbol_size],
uint32_t *signal_power, uint32_t *signal_power,
uint32_t *noise_power_per_rb, uint32_t *noise_power_per_rb,
uint32_t *noise_power, uint32_t *noise_power,
...@@ -982,8 +982,6 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB, ...@@ -982,8 +982,6 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
#endif #endif
const NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; const NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
int32_t ***srs_ls_estimated_channel = nr_srs_info->srs_ls_estimated_channel;
const uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*NR_NB_SC_PER_RB; const uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*NR_NB_SC_PER_RB;
uint8_t N_ap = 1<<srs_pdu->num_ant_ports; uint8_t N_ap = 1<<srs_pdu->num_ant_ports;
...@@ -1030,11 +1028,11 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB, ...@@ -1030,11 +1028,11 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
for (int cdm_idx = 0; cdm_idx < fd_cdm; cdm_idx++) { for (int cdm_idx = 0; cdm_idx < fd_cdm; cdm_idx++) {
int16_t generated_real = srs_generated_signal[p_index][subcarrier_cdm] & 0xFFFF; int16_t generated_real = ((c16_t*)srs_generated_signal[p_index])[subcarrier_cdm].r;
int16_t generated_imag = (srs_generated_signal[p_index][subcarrier_cdm] >> 16) & 0xFFFF; int16_t generated_imag = ((c16_t*)srs_generated_signal[p_index])[subcarrier_cdm].i;
int16_t received_real = srs_received_signal[ant][subcarrier_cdm] & 0xFFFF; int16_t received_real = ((c16_t*)srs_received_signal[ant])[subcarrier_cdm].r;
int16_t received_imag = (srs_received_signal[ant][subcarrier_cdm] >> 16) & 0xFFFF; int16_t received_imag = ((c16_t*)srs_received_signal[ant])[subcarrier_cdm].i;
// We know that nr_srs_info->srs_generated_signal_bits bits are enough to represent the generated_real and generated_imag. // We know that nr_srs_info->srs_generated_signal_bits bits are enough to represent the generated_real and generated_imag.
// So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits. // So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits.
...@@ -1120,10 +1118,10 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB, ...@@ -1120,10 +1118,10 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
} }
uint16_t base_idx = ant*N_ap*M_sc_b_SRS + p_index*M_sc_b_SRS; uint16_t base_idx = ant*N_ap*M_sc_b_SRS + p_index*M_sc_b_SRS;
for (int k = 0; k < M_sc_b_SRS; k++) { for (int k = 0; k < M_sc_b_SRS; k++) {
ch_real[base_idx+k] = (int16_t)(srs_estimated_channel_freq[ant][p_index][subcarrier] & 0xFFFF); ch_real[base_idx+k] = ((c16_t*)srs_estimated_channel_freq[ant][p_index])[subcarrier].r;
ch_imag[base_idx+k] = (int16_t)((srs_estimated_channel_freq[ant][p_index][subcarrier] >> 16) & 0xFFFF); ch_imag[base_idx+k] = ((c16_t*)srs_estimated_channel_freq[ant][p_index])[subcarrier].i;
noise_real[base_idx+k] = abs((int16_t)(srs_ls_estimated_channel[ant][p_index][subcarrier] & 0xFFFF) - ch_real[base_idx+k]); noise_real[base_idx+k] = abs(((c16_t*)srs_ls_estimated_channel[ant][p_index])[subcarrier].r - ch_real[base_idx+k]);
noise_imag[base_idx+k] = abs((int16_t)((srs_ls_estimated_channel[ant][p_index][subcarrier] >> 16) & 0xFFFF) - ch_imag[base_idx+k]); noise_imag[base_idx+k] = abs(((c16_t*)srs_ls_estimated_channel[ant][p_index])[subcarrier].i - ch_imag[base_idx+k]);
subcarrier += K_TC; subcarrier += K_TC;
if (subcarrier >= frame_parms->ofdm_symbol_size) { if (subcarrier >= frame_parms->ofdm_symbol_size) {
subcarrier=subcarrier-frame_parms->ofdm_symbol_size; subcarrier=subcarrier-frame_parms->ofdm_symbol_size;
......
...@@ -56,7 +56,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq ...@@ -56,7 +56,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
int nr_est_timing_advance_pusch(PHY_VARS_gNB* phy_vars_gNB, int UE_id); int nr_est_timing_advance_pusch(PHY_VARS_gNB* phy_vars_gNB, int UE_id);
int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms, int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
const int32_t **srs_estimated_channel_time); const int32_t srs_estimated_channel_time[][frame_parms->ofdm_symbol_size]);
void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
...@@ -72,10 +72,11 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB, ...@@ -72,10 +72,11 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
const nfapi_nr_srs_pdu_t *srs_pdu, const nfapi_nr_srs_pdu_t *srs_pdu,
const nr_srs_info_t *nr_srs_info, const nr_srs_info_t *nr_srs_info,
const int32_t **srs_generated_signal, const int32_t **srs_generated_signal,
const int32_t **srs_received_signal, int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
int32_t ***srs_estimated_channel_freq, int32_t srs_ls_estimated_channel[][MAX_NUM_NR_SRS_AP][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
int32_t ***srs_estimated_channel_time, int32_t srs_estimated_channel_freq[][MAX_NUM_NR_SRS_AP][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
int32_t ***srs_estimated_channel_time_shifted, int32_t srs_estimated_channel_time[][MAX_NUM_NR_SRS_AP][gNB->frame_parms.ofdm_symbol_size],
int32_t srs_estimated_channel_time_shifted[][MAX_NUM_NR_SRS_AP][gNB->frame_parms.ofdm_symbol_size],
uint32_t *signal_power, uint32_t *signal_power,
uint32_t *noise_power_per_rb, uint32_t *noise_power_per_rb,
uint32_t *noise_power, uint32_t *noise_power,
......
...@@ -330,7 +330,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, ...@@ -330,7 +330,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
int slot, int slot,
nfapi_nr_srs_pdu_t *srs_pdu, nfapi_nr_srs_pdu_t *srs_pdu,
nr_srs_info_t *nr_srs_info, nr_srs_info_t *nr_srs_info,
int32_t **srs_received_signal); int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)]);
void init_prach_list(PHY_VARS_gNB *gNB); void init_prach_list(PHY_VARS_gNB *gNB);
void init_prach_ru_list(RU_t *ru); void init_prach_ru_list(RU_t *ru);
......
...@@ -100,7 +100,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, ...@@ -100,7 +100,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
int slot, int slot,
nfapi_nr_srs_pdu_t *srs_pdu, nfapi_nr_srs_pdu_t *srs_pdu,
nr_srs_info_t *nr_srs_info, nr_srs_info_t *nr_srs_info,
int32_t **srs_received_signal) { int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)]) {
#ifdef SRS_DEBUG #ifdef SRS_DEBUG
LOG_I(NR_PHY,"Calling %s function\n", __FUNCTION__); LOG_I(NR_PHY,"Calling %s function\n", __FUNCTION__);
......
...@@ -1657,7 +1657,6 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1657,7 +1657,6 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
RX_type_t rx_type) RX_type_t rx_type)
{ {
//#define DEBUG_DL_PTRS 1 //#define DEBUG_DL_PTRS 1
int16_t *phase_per_symbol = NULL;
int32_t *ptrs_re_symbol = NULL; int32_t *ptrs_re_symbol = NULL;
int8_t ret = 0; int8_t ret = 0;
/* harq specific variables */ /* harq specific variables */
...@@ -1701,20 +1700,20 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1701,20 +1700,20 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
} }
/* loop over antennas */ /* loop over antennas */
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
phase_per_symbol = (int16_t*)pdsch_vars[gNB_id]->ptrs_phase_per_slot[aarx]; c16_t *phase_per_symbol = (c16_t*)pdsch_vars[gNB_id]->ptrs_phase_per_slot[aarx];
ptrs_re_symbol = (int32_t*)pdsch_vars[gNB_id]->ptrs_re_per_slot[aarx]; ptrs_re_symbol = (int32_t*)pdsch_vars[gNB_id]->ptrs_re_per_slot[aarx];
ptrs_re_symbol[symbol] = 0; ptrs_re_symbol[symbol] = 0;
phase_per_symbol[(2*symbol)+1] = 0; // Imag phase_per_symbol[symbol].i = 0; // Imag
/* set DMRS estimates to 0 angle with magnitude 1 */ /* set DMRS estimates to 0 angle with magnitude 1 */
if(is_dmrs_symbol(symbol,*dmrsSymbPos)) { if(is_dmrs_symbol(symbol,*dmrsSymbPos)) {
/* set DMRS real estimation to 32767 */ /* set DMRS real estimation to 32767 */
phase_per_symbol[2*symbol]=(int16_t)((1<<15)-1); // 32767 phase_per_symbol[symbol].r=INT16_MAX; // 32767
#ifdef DEBUG_DL_PTRS #ifdef DEBUG_DL_PTRS
printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[2*symbol],phase_per_symbol[(2*symbol)+1]); printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[symbol].r,phase_per_symbol[symbol].i);
#endif #endif
} }
else { // real ptrs value is set to 0 else { // real ptrs value is set to 0
phase_per_symbol[2*symbol] = 0; // Real phase_per_symbol[symbol].r = 0; // Real
} }
if(dlsch0_harq->status == ACTIVE) { if(dlsch0_harq->status == ACTIVE) {
...@@ -1740,7 +1739,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1740,7 +1739,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
symbol,frame_parms->ofdm_symbol_size, symbol,frame_parms->ofdm_symbol_size,
(int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(symbol * nb_re_pdsch)], (int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(symbol * nb_re_pdsch)],
ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0], ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0],
&phase_per_symbol[2* symbol], (int16_t*)&phase_per_symbol[symbol],
&ptrs_re_symbol[symbol]); &ptrs_re_symbol[symbol]);
} }
}// HARQ 0 }// HARQ 0
...@@ -1752,7 +1751,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1752,7 +1751,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
/*------------------------------------------------------------------------------------------------------- */ /*------------------------------------------------------------------------------------------------------- */
/* If L-PTRS is > 0 then we need interpolation */ /* If L-PTRS is > 0 then we need interpolation */
if(*L_ptrs > 0) { if(*L_ptrs > 0) {
ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, phase_per_symbol, *startSymbIndex, *nbSymb); ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, (int16_t*)phase_per_symbol, *startSymbIndex, *nbSymb);
if(ret != 0) { if(ret != 0) {
LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n"); LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n");
} }
...@@ -1771,11 +1770,11 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1771,11 +1770,11 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
/* Skip rotation if the slot processing is wrong */ /* Skip rotation if the slot processing is wrong */
if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) { if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) {
#ifdef DEBUG_DL_PTRS #ifdef DEBUG_DL_PTRS
printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[2* i],phase_per_symbol[(2* i) +1]); printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i);
#endif #endif
rotate_cpx_vector((int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)], rotate_cpx_vector((c16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
&phase_per_symbol[2* i], &phase_per_symbol[i],
(int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)], (c16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
((*nb_rb) * NR_NB_SC_PER_RB), 15); ((*nb_rb) * NR_NB_SC_PER_RB), 15);
}// if not DMRS Symbol }// if not DMRS Symbol
}// symbol loop }// symbol loop
......
...@@ -342,7 +342,7 @@ typedef struct { ...@@ -342,7 +342,7 @@ typedef struct {
/// Position of first CCE of the dci /// Position of first CCE of the dci
int firstCCE; int firstCCE;
/// flag to indicate that this is a RA response /// flag to indicate that this is a RA response
boolean_t ra_flag; bool ra_flag;
/// rnti /// rnti
rnti_t rnti; rnti_t rnti;
/// rnti type /// rnti type
......
...@@ -597,17 +597,15 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, ...@@ -597,17 +597,15 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
for(ap = 0; ap < n_antenna_ports; ap++) { for(ap = 0; ap < n_antenna_ports; ap++) {
for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT;s++){ for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT;s++){
c16_t rot=((c16_t*)frame_parms->symbol_rotation[1])[s + symb_offset];
LOG_D(PHY,"In %s: rotating txdataF symbol %d (%d) => (%d.%d)\n", LOG_D(PHY,"rotating txdataF symbol %d (%d) => (%d.%d)\n",
__FUNCTION__, s,
s, s + symb_offset,
s + symb_offset, rot.r, rot.i);
frame_parms->symbol_rotation[1][2 * (s + symb_offset)],
frame_parms->symbol_rotation[1][1 + (2 * (s + symb_offset))]); rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
&rot,
rotate_cpx_vector((int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s], (c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
&frame_parms->symbol_rotation[1][2 * (s + symb_offset)],
(int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
15); 15);
} }
......
...@@ -34,7 +34,7 @@ typedef struct OAIgraph { ...@@ -34,7 +34,7 @@ typedef struct OAIgraph {
int h; int h;
int waterFallh; int waterFallh;
double *waterFallAvg; double *waterFallAvg;
boolean_t initDone; bool initDone;
int iteration; int iteration;
void (*funct) (struct OAIgraph *graph, calibData_t *); void (*funct) (struct OAIgraph *graph, calibData_t *);
} OAIgraph_t; } OAIgraph_t;
...@@ -159,7 +159,7 @@ static void oai_xygraph_getbuff(OAIgraph_t *graph, float **x, float **y, int len ...@@ -159,7 +159,7 @@ static void oai_xygraph_getbuff(OAIgraph_t *graph, float **x, float **y, int len
*y=old_y; *y=old_y;
} }
static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int layer, boolean_t NoAutoScale) { static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int layer, bool NoAutoScale) {
fl_redraw_object(graph->graph); fl_redraw_object(graph->graph);
if ( NoAutoScale && graph->iteration%NoAutoScale == 0) { if ( NoAutoScale && graph->iteration%NoAutoScale == 0) {
......
This diff is collapsed.
...@@ -60,7 +60,7 @@ typedef struct OAIgraph { ...@@ -60,7 +60,7 @@ typedef struct OAIgraph {
int h; int h;
int waterFallh; int waterFallh;
double *waterFallAvg; double *waterFallAvg;
boolean_t initDone; bool initDone;
int iteration; int iteration;
void (*gNBfunct) (struct OAIgraph *graph, scopeData_t *p, int UE_id); void (*gNBfunct) (struct OAIgraph *graph, scopeData_t *p, int UE_id);
void (*nrUEfunct)(scopeGraphData_t **data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); void (*nrUEfunct)(scopeGraphData_t **data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id);
...@@ -208,7 +208,7 @@ static void oai_xygraph_getbuff(OAIgraph_t *graph, float **x, float **y, int len ...@@ -208,7 +208,7 @@ static void oai_xygraph_getbuff(OAIgraph_t *graph, float **x, float **y, int len
*y=old_y; *y=old_y;
} }
static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int layer, boolean_t NoAutoScale) { static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int layer, bool NoAutoScale) {
fl_redraw_object(graph->graph); fl_redraw_object(graph->graph);
if ( NoAutoScale && graph->iteration%NoAutoScale == 0) { if ( NoAutoScale && graph->iteration%NoAutoScale == 0) {
......
...@@ -37,6 +37,7 @@ extern "C" { ...@@ -37,6 +37,7 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#include <assert.h> #include <assert.h>
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "common/utils/assertions.h"
#define CEILIDIV(a,b) ((a+b-1)/b) #define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
...@@ -109,15 +110,6 @@ void multadd_complex_vector_real_scalar(int16_t *x, ...@@ -109,15 +110,6 @@ void multadd_complex_vector_real_scalar(int16_t *x,
uint8_t zero_flag, uint8_t zero_flag,
uint32_t N); uint32_t N);
int rotate_cpx_vector(int16_t *x,
int16_t *alpha,
int16_t *y,
uint32_t N,
uint16_t output_shift);
/*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev) /*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev)
\brief Initialize the FFT engine for a given size \brief Initialize the FFT engine for a given size
@param size Size of the FFT @param size Size of the FFT
...@@ -466,7 +458,7 @@ idft_size_idx_t get_idft(int ofdm_symbol_size) ...@@ -466,7 +458,7 @@ idft_size_idx_t get_idft(int ofdm_symbol_size)
} }
/*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift) /*!\fn int32_t rotate_cpx_vector(c16_t *x,c16_t *alpha,c16_t *y,uint32_t N,uint16_t output_shift)
This function performs componentwise multiplication of a vector with a complex scalar. This function performs componentwise multiplication of a vector with a complex scalar.
@param x Vector input (Q1.15) in the format |Re0 Im0|,......,|Re(N-1) Im(N-1)| @param x Vector input (Q1.15) in the format |Re0 Im0|,......,|Re(N-1) Im(N-1)|
@param alpha Scalar input (Q1.15) in the format |Re0 Im0| @param alpha Scalar input (Q1.15) in the format |Re0 Im0|
...@@ -476,11 +468,11 @@ This function performs componentwise multiplication of a vector with a complex s ...@@ -476,11 +468,11 @@ This function performs componentwise multiplication of a vector with a complex s
The function implemented is : \f$\mathbf{y} = \alpha\mathbf{x}\f$ The function implemented is : \f$\mathbf{y} = \alpha\mathbf{x}\f$
*/ */
int32_t rotate_cpx_vector(int16_t *x, void rotate_cpx_vector(c16_t *x,
int16_t *alpha, c16_t *alpha,
int16_t *y, c16_t *y,
uint32_t N, uint32_t N,
uint16_t output_shift); uint16_t output_shift);
//cadd_sv.c //cadd_sv.c
......
...@@ -755,7 +755,7 @@ typedef struct { ...@@ -755,7 +755,7 @@ typedef struct {
/// Position of first CCE of the dci /// Position of first CCE of the dci
int firstCCE; int firstCCE;
/// flag to indicate that this is a RA response /// flag to indicate that this is a RA response
boolean_t ra_flag; bool ra_flag;
/// rnti /// rnti
rnti_t rnti; rnti_t rnti;
/// harq_pid /// harq_pid
...@@ -776,7 +776,7 @@ typedef struct { ...@@ -776,7 +776,7 @@ typedef struct {
/// Position of first CCE of the dci /// Position of first CCE of the dci
int firstCCE; int firstCCE;
/// flag to indicate that this is a RA response /// flag to indicate that this is a RA response
boolean_t ra_flag; bool ra_flag;
/// rnti /// rnti
rnti_t rnti; rnti_t rnti;
/// Format /// Format
...@@ -807,7 +807,7 @@ typedef struct { ...@@ -807,7 +807,7 @@ typedef struct {
/// Position of first CCE of the dci /// Position of first CCE of the dci
int firstCCE; int firstCCE;
/// flag to indicate that this is a RA response /// flag to indicate that this is a RA response
boolean_t ra_flag; bool ra_flag;
/// rnti /// rnti
rnti_t rnti; rnti_t rnti;
/// Format /// Format
......
...@@ -241,19 +241,9 @@ typedef struct { ...@@ -241,19 +241,9 @@ typedef struct {
} NR_PRACH_RESOURCES_t; } NR_PRACH_RESOURCES_t;
typedef struct { typedef struct {
uint8_t **k_0_p; uint8_t k_0_p[MAX_NUM_NR_SRS_AP][MAX_NUM_NR_SRS_SYMBOLS];
uint8_t srs_generated_signal_bits; uint8_t srs_generated_signal_bits;
int32_t **srs_generated_signal; int32_t **srs_generated_signal;
int32_t **srs_received_signal;
int32_t ***srs_ls_estimated_channel;
int32_t ***srs_estimated_channel_freq;
int32_t ***srs_estimated_channel_time;
int32_t ***srs_estimated_channel_time_shifted;
uint32_t signal_power;
uint32_t noise_power_per_rb[273];
uint32_t noise_power;
int8_t snr_per_rb[273];
int8_t snr;
} nr_srs_info_t; } nr_srs_info_t;
typedef struct { typedef struct {
...@@ -363,10 +353,10 @@ struct NR_DL_FRAME_PARMS { ...@@ -363,10 +353,10 @@ struct NR_DL_FRAME_PARMS {
lte_prefix_type_t Ncp; lte_prefix_type_t Ncp;
/// sequence which is computed based on carrier frequency and numerology to rotate/derotate each OFDM symbol according to Section 5.3 in 38.211 /// sequence which is computed based on carrier frequency and numerology to rotate/derotate each OFDM symbol according to Section 5.3 in 38.211
/// First dimension is for the direction of the link (0 DL, 1 UL) /// First dimension is for the direction of the link (0 DL, 1 UL)
int16_t symbol_rotation[2][224*2]; c16_t symbol_rotation[2][224];
/// sequence used to compensate the phase rotation due to timeshifted OFDM symbols /// sequence used to compensate the phase rotation due to timeshifted OFDM symbols
/// First dimenstion is for different CP lengths /// First dimenstion is for different CP lengths
int16_t timeshift_symbol_rotation[4096*2] __attribute__ ((aligned (16))); c16_t timeshift_symbol_rotation[4096*2] __attribute__ ((aligned (16)));
/// shift of pilot position in one RB /// shift of pilot position in one RB
uint8_t nushift; uint8_t nushift;
/// SRS configuration from TS 38.331 RRC /// SRS configuration from TS 38.331 RRC
......
This diff is collapsed.
...@@ -460,7 +460,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue, ...@@ -460,7 +460,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,
is_pucch2_subframe = (is_ri_TXOp(ue,proc,eNB_id) && (ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex>0)) || is_pucch2_subframe; is_pucch2_subframe = (is_ri_TXOp(ue,proc,eNB_id) && (ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex>0)) || is_pucch2_subframe;
// check ACK/SR transmission // check ACK/SR transmission
if(frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission == FALSE) { if(frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission == false) {
if(is_SR_TXOp(ue,proc,eNB_id)) { if(is_SR_TXOp(ue,proc,eNB_id)) {
uint32_t SR_payload = 0; uint32_t SR_payload = 0;
......
...@@ -43,27 +43,6 @@ Description Contains global common definitions ...@@ -43,27 +43,6 @@ Description Contains global common definitions
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
/* boolean_t is also defined in openair2/COMMON/platform_types.h
* let's protect potential redefinition
*/
#ifndef _BOOLEAN_T_DEFINED_
#define _BOOLEAN_T_DEFINED_
typedef signed char boolean_t;
#if !defined(TRUE)
#define TRUE (boolean_t)0x01
#endif
#if !defined(FALSE)
#define FALSE (boolean_t)0x00
#endif
#define BOOL_NOT(b) (b^TRUE)
#endif /* _BOOLEAN_T_DEFINED_ */
#define NAS_UE_ID_FMT "0x%06x" #define NAS_UE_ID_FMT "0x%06x"
/****************************************************************************/ /****************************************************************************/
......
...@@ -145,7 +145,7 @@ struct mac_tx_tb_management { ...@@ -145,7 +145,7 @@ struct mac_tx_tb_management {
struct mac_rx_tb_management { struct mac_rx_tb_management {
unsigned char *data_ptr; unsigned char *data_ptr;
tb_size_t tb_size; // in bits tb_size_t tb_size; // in bits
boolean_t valid_checksum; bool valid_checksum;
unsigned char first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc unsigned char first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc
}; };
......
...@@ -32,35 +32,12 @@ ...@@ -32,35 +32,12 @@
#if !defined(NAS_NETLINK) #if !defined(NAS_NETLINK)
#include <stdint.h> #include <stdint.h>
#include <stdbool.h>
#else #else
#include <linux/types.h> #include <linux/types.h>
typedef void * intptr_t; typedef void * intptr_t;
#endif #endif
//-----------------------------------------------------------------------------
// GENERIC TYPES
//-----------------------------------------------------------------------------
/* boolean_t is also defined in openair2/COMMON/commonDef.h,
* let's protect potential redefinition
*/
#ifndef _BOOLEAN_T_DEFINED_
#define _BOOLEAN_T_DEFINED_
typedef signed char boolean_t;
#if !defined(TRUE)
#define TRUE (boolean_t)0x01
#endif
#if !defined(FALSE)
#define FALSE (boolean_t)0x00
#endif
#define BOOL_NOT(b) (b^TRUE)
#endif /* _BOOLEAN_T_DEFINED_ */
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// GENERIC ACCESS STRATUM TYPES // GENERIC ACCESS STRATUM TYPES
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -77,25 +54,25 @@ typedef int16_t smodule_id_t; ...@@ -77,25 +54,25 @@ typedef int16_t smodule_id_t;
typedef long rb_id_t; typedef long rb_id_t;
typedef long srb_id_t; typedef long srb_id_t;
typedef boolean_t MBMS_flag_t; typedef bool MBMS_flag_t;
#define MBMS_FLAG_NO FALSE #define MBMS_FLAG_NO false
#define MBMS_FLAG_YES TRUE #define MBMS_FLAG_YES true
typedef boolean_t eNB_flag_t; typedef bool eNB_flag_t;
#define ENB_FLAG_NO FALSE #define ENB_FLAG_NO false
#define ENB_FLAG_YES TRUE #define ENB_FLAG_YES true
typedef boolean_t gNB_flag_t; typedef bool gNB_flag_t;
#define GNB_FLAG_NO FALSE #define GNB_FLAG_NO false
#define GNB_FLAG_YES TRUE #define GNB_FLAG_YES true
typedef boolean_t srb_flag_t; typedef bool srb_flag_t;
#define SRB_FLAG_NO FALSE #define SRB_FLAG_NO false
#define SRB_FLAG_YES TRUE #define SRB_FLAG_YES true
typedef boolean_t sl_discovery_flag_t; typedef bool sl_discovery_flag_t;
#define SL_DISCOVERY_FLAG_NO FALSE #define SL_DISCOVERY_FLAG_NO false
#define SL_DISCOVERY_FLAG_YES TRUE #define SL_DISCOVERY_FLAG_YES true
typedef enum link_direction_e { typedef enum link_direction_e {
UNKNOWN_DIR = 0, UNKNOWN_DIR = 0,
...@@ -152,8 +129,8 @@ typedef uint16_t rlc_usn_t; ...@@ -152,8 +129,8 @@ typedef uint16_t rlc_usn_t;
typedef int32_t rlc_buffer_occupancy_t; typedef int32_t rlc_buffer_occupancy_t;
typedef signed int rlc_op_status_t; typedef signed int rlc_op_status_t;
#define SDU_CONFIRM_NO FALSE #define SDU_CONFIRM_NO false
#define SDU_CONFIRM_YES TRUE #define SDU_CONFIRM_YES true
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// PDCP TYPES // PDCP TYPES
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -242,7 +219,7 @@ typedef struct protocol_ctxt_s { ...@@ -242,7 +219,7 @@ typedef struct protocol_ctxt_s {
frame_t frame; /*!< \brief LTE frame number.*/ frame_t frame; /*!< \brief LTE frame number.*/
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/ sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */ eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
boolean_t brOption; bool brOption;
} protocol_ctxt_t; } protocol_ctxt_t;
// warning time hardcoded // warning time hardcoded
#define PROTOCOL_CTXT_TIME_MILLI_SECONDS(CtXt_h) ((CtXt_h)->frame*10+(CtXt_h)->subframe) #define PROTOCOL_CTXT_TIME_MILLI_SECONDS(CtXt_h) ((CtXt_h)->frame*10+(CtXt_h)->subframe)
......
...@@ -583,9 +583,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -583,9 +583,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
"Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n", "Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n",
RC.config_file_name, i, ENB_CONFIG_STRING_PRACH_HIGH_SPEED); RC.config_file_name, i, ENB_CONFIG_STRING_PRACH_HIGH_SPEED);
else if (strcmp(ccparams_lte.prach_high_speed, "ENABLE") == 0) { else if (strcmp(ccparams_lte.prach_high_speed, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_high_speed = TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_high_speed = true;
} else if (strcmp(ccparams_lte.prach_high_speed, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.prach_high_speed, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_high_speed = FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_high_speed = false;
} else } else
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for prach_config choice: ENABLE,DISABLE !\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for prach_config choice: ENABLE,DISABLE !\n",
...@@ -689,9 +689,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -689,9 +689,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
"Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n", "Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n",
RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM); RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM);
else if (strcmp(ccparams_lte.pusch_enable64QAM, "ENABLE") == 0) { else if (strcmp(ccparams_lte.pusch_enable64QAM, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_enable64QAM = TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_enable64QAM = true;
} else if (strcmp(ccparams_lte.pusch_enable64QAM, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.pusch_enable64QAM, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_enable64QAM = FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_enable64QAM = false;
} else } else
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n",
...@@ -702,9 +702,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -702,9 +702,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
"Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n", "Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n",
RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN); RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN);
else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "ENABLE") == 0) { else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupHoppingEnabled = TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupHoppingEnabled = true;
} else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupHoppingEnabled= FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupHoppingEnabled= false;
} else } else
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n",
...@@ -723,9 +723,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -723,9 +723,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
"Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n", "Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n",
RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN); RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN);
else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "ENABLE") == 0) { else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_sequenceHoppingEnabled = TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_sequenceHoppingEnabled = true;
} else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_sequenceHoppingEnabled = FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_sequenceHoppingEnabled = false;
} else } else
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_sequenceHoppingEnabled choice: ENABLE,DISABLE!\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_sequenceHoppingEnabled choice: ENABLE,DISABLE!\n",
...@@ -766,15 +766,15 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -766,15 +766,15 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_duration,ccparams_lte.phich_duration); RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_duration,ccparams_lte.phich_duration);
if (strcmp(ccparams_lte.srs_enable, "ENABLE") == 0) { if (strcmp(ccparams_lte.srs_enable, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable= TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable= true;
} else if (strcmp(ccparams_lte.srs_enable, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.srs_enable, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable= FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable= false;
} else } else
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
RC.config_file_name, i, ccparams_lte.srs_enable); RC.config_file_name, i, ccparams_lte.srs_enable);
if (RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable== TRUE) { if (RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable== true) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_BandwidthConfig= ccparams_lte.srs_BandwidthConfig; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_BandwidthConfig= ccparams_lte.srs_BandwidthConfig;
if ((ccparams_lte.srs_BandwidthConfig < 0) || if ((ccparams_lte.srs_BandwidthConfig < 0) ||
...@@ -791,18 +791,18 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -791,18 +791,18 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
RC.config_file_name, i, ccparams_lte.srs_SubframeConfig); RC.config_file_name, i, ccparams_lte.srs_SubframeConfig);
if (strcmp(ccparams_lte.srs_ackNackST, "ENABLE") == 0) { if (strcmp(ccparams_lte.srs_ackNackST, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_ackNackST= TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_ackNackST= true;
} else if (strcmp(ccparams_lte.srs_ackNackST, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.srs_ackNackST, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_ackNackST= FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_ackNackST= false;
} else } else
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
RC.config_file_name, i, ccparams_lte.srs_ackNackST); RC.config_file_name, i, ccparams_lte.srs_ackNackST);
if (strcmp(ccparams_lte.srs_MaxUpPts, "ENABLE") == 0) { if (strcmp(ccparams_lte.srs_MaxUpPts, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_MaxUpPts= TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_MaxUpPts= true;
} else if (strcmp(ccparams_lte.srs_MaxUpPts, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.srs_MaxUpPts, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_MaxUpPts= FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_MaxUpPts= false;
} else } else
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n",
...@@ -921,7 +921,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -921,7 +921,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
RC.config_file_name, i, ccparams_lte.rach_numberOfRA_Preambles); RC.config_file_name, i, ccparams_lte.rach_numberOfRA_Preambles);
if (strcmp(ccparams_lte.rach_preamblesGroupAConfig, "ENABLE") == 0) { if (strcmp(ccparams_lte.rach_preamblesGroupAConfig, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preamblesGroupAConfig= TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preamblesGroupAConfig= true;
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_sizeOfRA_PreamblesGroupA= (ccparams_lte.rach_sizeOfRA_PreamblesGroupA/4)-1; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_sizeOfRA_PreamblesGroupA= (ccparams_lte.rach_sizeOfRA_PreamblesGroupA/4)-1;
if ((ccparams_lte.rach_numberOfRA_Preambles <4) || if ((ccparams_lte.rach_numberOfRA_Preambles <4) ||
...@@ -976,7 +976,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -976,7 +976,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n",
RC.config_file_name, i, ccparams_lte.rach_messagePowerOffsetGroupB); RC.config_file_name, i, ccparams_lte.rach_messagePowerOffsetGroupB);
} else if (strcmp(ccparams_lte.rach_preamblesGroupAConfig, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.rach_preamblesGroupAConfig, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preamblesGroupAConfig= FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preamblesGroupAConfig= false;
} else } else
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for rach_preamblesGroupAConfig choice: ENABLE,DISABLE !\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for rach_preamblesGroupAConfig choice: ENABLE,DISABLE !\n",
...@@ -1254,9 +1254,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { ...@@ -1254,9 +1254,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
"Failed to parse eNB configuration file %s, enb %u define %s: TRUE,FALSE!\n", "Failed to parse eNB configuration file %s, enb %u define %s: TRUE,FALSE!\n",
RC.config_file_name, i, ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL); RC.config_file_name, i, ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL);
else if (strcmp(ccparams_lte.mbms_dedicated_serving_cell, "ENABLE") == 0) { else if (strcmp(ccparams_lte.mbms_dedicated_serving_cell, "ENABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].mbms_dedicated_serving_cell = TRUE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].mbms_dedicated_serving_cell = true;
} else if (strcmp(ccparams_lte.mbms_dedicated_serving_cell, "DISABLE") == 0) { } else if (strcmp(ccparams_lte.mbms_dedicated_serving_cell, "DISABLE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].mbms_dedicated_serving_cell = FALSE; RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].mbms_dedicated_serving_cell = false;
} else { } else {
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for mbms_dedicated_serving_cell choice: TRUE or FALSE !\n", "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for mbms_dedicated_serving_cell choice: TRUE or FALSE !\n",
......
This diff is collapsed.
...@@ -127,7 +127,7 @@ int flexran_get_mac_ue_id_rnti(mid_t mod_id, rnti_t rnti) { ...@@ -127,7 +127,7 @@ int flexran_get_mac_ue_id_rnti(mid_t mod_id, rnti_t rnti) {
/* get the (active) UE with RNTI i */ /* get the (active) UE with RNTI i */
for (n = 0; n < MAX_MOBILES_PER_ENB; ++n) { for (n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
if (RC.mac[mod_id]->UE_info.active[n] == TRUE if (RC.mac[mod_id]->UE_info.active[n] == true
&& rnti == UE_RNTI(mod_id, n)) { && rnti == UE_RNTI(mod_id, n)) {
return n; return n;
} }
...@@ -143,7 +143,7 @@ int flexran_get_mac_ue_id(mid_t mod_id, int i) { ...@@ -143,7 +143,7 @@ int flexran_get_mac_ue_id(mid_t mod_id, int i) {
/* get the (i+1)'th active UE */ /* get the (i+1)'th active UE */
for (n = 0; n < MAX_MOBILES_PER_ENB; ++n) { for (n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
if (RC.mac[mod_id]->UE_info.active[n] == TRUE) { if (RC.mac[mod_id]->UE_info.active[n] == true) {
if (i == 0) if (i == 0)
return n; return n;
...@@ -580,7 +580,7 @@ uint8_t flexran_get_n_SB(mid_t mod_id, uint8_t cc_id) { ...@@ -580,7 +580,7 @@ uint8_t flexran_get_n_SB(mid_t mod_id, uint8_t cc_id) {
Protocol__FlexQam flexran_get_enable64QAM(mid_t mod_id, uint8_t cc_id) { Protocol__FlexQam flexran_get_enable64QAM(mid_t mod_id, uint8_t cc_id) {
if (!phy_is_present(mod_id, cc_id)) return 0; if (!phy_is_present(mod_id, cc_id)) return 0;
if (RC.eNB[mod_id][cc_id]->frame_parms.pusch_config_common.enable64QAM == TRUE) if (RC.eNB[mod_id][cc_id]->frame_parms.pusch_config_common.enable64QAM == true)
return PROTOCOL__FLEX_QAM__FLEQ_MOD_64QAM; return PROTOCOL__FLEX_QAM__FLEQ_MOD_64QAM;
else else
return PROTOCOL__FLEX_QAM__FLEQ_MOD_16QAM; return PROTOCOL__FLEX_QAM__FLEQ_MOD_16QAM;
...@@ -3585,7 +3585,7 @@ int flexran_set_new_plmn_id(mid_t mod_id, int CC_id, size_t n_plmn, Protocol__Fl ...@@ -3585,7 +3585,7 @@ int flexran_set_new_plmn_id(mid_t mod_id, int CC_id, size_t n_plmn, Protocol__Fl
int CC_id, int CC_id,
BOOLEAN_t brOption, BOOLEAN_t brOption,
RrcConfigurationReq *configuration); RrcConfigurationReq *configuration);
carrier->sizeof_SIB1 = do_SIB1(carrier, mod_id, CC_id, FALSE, conf); carrier->sizeof_SIB1 = do_SIB1(carrier, mod_id, CC_id, false, conf);
if (carrier->sizeof_SIB1 < 0) if (carrier->sizeof_SIB1 < 0)
return -1337; /* SIB1 encoding failed, hell will probably break loose */ return -1337; /* SIB1 encoding failed, hell will probably break loose */
......
...@@ -32,18 +32,18 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, ...@@ -32,18 +32,18 @@ void apply_macrlc_config(gNB_RRC_INST *rrc,
abort(); abort();
} }
boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p, bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const srb_flag_t srb_flag, const srb_flag_t srb_flag,
const rb_id_t rb_id, const rb_id_t rb_id,
const mui_t mui, const mui_t mui,
const confirm_t confirm, const confirm_t confirm,
const sdu_size_t sdu_buffer_size, const sdu_size_t sdu_buffer_size,
unsigned char *const sdu_buffer, unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t pt_mode, const pdcp_transmission_mode_t pt_mode,
const uint32_t *sourceL2Id, const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id, const uint32_t *destinationL2Id,
const uint8_t qfi, const uint8_t qfi,
const boolean_t rqi, const bool rqi,
const int pdusession_id) { const int pdusession_id) {
abort(); abort();
} }
...@@ -363,13 +363,6 @@ ...@@ -363,13 +363,6 @@
# error "You are compiling f1ap with the wrong version of ASN1C" # error "You are compiling f1ap with the wrong version of ASN1C"
#endif #endif
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
#define F1AP_UE_ID_FMT "0x%06"PRIX32 #define F1AP_UE_ID_FMT "0x%06"PRIX32
#include "assertions.h" #include "assertions.h"
......
...@@ -509,7 +509,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -509,7 +509,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
LOG_I(F1AP, "Received DL RRC Transfer on srb_id %ld\n", srb_id); LOG_I(F1AP, "Received DL RRC Transfer on srb_id %ld\n", srb_id);
rlc_op_status_t rlc_status; rlc_op_status_t rlc_status;
boolean_t ret = TRUE; bool ret = true;
mem_block_t *pdcp_pdu_p = NULL; mem_block_t *pdcp_pdu_p = NULL;
pdcp_pdu_p = get_free_mem_block(rrc_dl_sdu_len, __func__); pdcp_pdu_p = get_free_mem_block(rrc_dl_sdu_len, __func__);
...@@ -539,27 +539,27 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -539,27 +539,27 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
switch (rlc_status) { switch (rlc_status) {
case RLC_OP_STATUS_OK: case RLC_OP_STATUS_OK:
//LOG_I(F1AP, "Data sending request over RLC succeeded!\n"); //LOG_I(F1AP, "Data sending request over RLC succeeded!\n");
ret=TRUE; ret=true;
break; break;
case RLC_OP_STATUS_BAD_PARAMETER: case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(F1AP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n"); LOG_W(F1AP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
ret= FALSE; ret= false;
break; break;
case RLC_OP_STATUS_INTERNAL_ERROR: case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(F1AP, "Data sending request over RLC failed with 'Internal Error' reason!\n"); LOG_W(F1AP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
ret= FALSE; ret= false;
break; break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES: case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(F1AP, "Data sending request over RLC failed with 'Out of Resources' reason!\n"); LOG_W(F1AP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
ret= FALSE; ret= false;
break; break;
default: default:
LOG_W(F1AP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status); LOG_W(F1AP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
ret= FALSE; ret= false;
break; break;
} // switch case } // switch case
...@@ -667,9 +667,9 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -667,9 +667,9 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
UE_sched_ctrl_t *UE_scheduling_control = &(RC.mac[instance]->UE_info.UE_sched_ctrl[UE_id_mac]); UE_sched_ctrl_t *UE_scheduling_control = &(RC.mac[instance]->UE_info.UE_sched_ctrl[UE_id_mac]);
if (UE_scheduling_control->cdrx_waiting_ack == TRUE) { if (UE_scheduling_control->cdrx_waiting_ack == true) {
UE_scheduling_control->cdrx_waiting_ack = FALSE; UE_scheduling_control->cdrx_waiting_ack = false;
UE_scheduling_control->cdrx_configured = TRUE; // Set to TRUE when RRC Connection Reconfiguration Complete is received UE_scheduling_control->cdrx_configured = true; // Set to TRUE when RRC Connection Reconfiguration Complete is received
LOG_I(F1AP, "CDRX configuration activated after RRC Connection Reconfiguration Complete reception\n"); LOG_I(F1AP, "CDRX configuration activated after RRC Connection Reconfiguration Complete reception\n");
} }
......
...@@ -42,16 +42,16 @@ ...@@ -42,16 +42,16 @@
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include <openair3/ocp-gtpu/gtp_itf.h> #include <openair3/ocp-gtpu/gtp_itf.h>
boolean_t lteDURecvCb( protocol_ctxt_t *ctxt_pP, bool lteDURecvCb(protocol_ctxt_t *ctxt_pP,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
const rb_id_t rb_idP, const rb_id_t rb_idP,
const mui_t muiP, const mui_t muiP,
const confirm_t confirmP, const confirm_t confirmP,
const sdu_size_t sdu_buffer_sizeP, const sdu_size_t sdu_buffer_sizeP,
unsigned char *const sdu_buffer_pP, unsigned char *const sdu_buffer_pP,
const pdcp_transmission_mode_t modeP, const pdcp_transmission_mode_t modeP,
const uint32_t *sourceL2Id, const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id) { const uint32_t *destinationL2Id) {
// The buffer comes from the stack in gtp-u thread, we have a make a separate buffer to enqueue in a inter-thread message queue // The buffer comes from the stack in gtp-u thread, we have a make a separate buffer to enqueue in a inter-thread message queue
mem_block_t *sdu=get_free_mem_block(sdu_buffer_sizeP, __func__); mem_block_t *sdu=get_free_mem_block(sdu_buffer_sizeP, __func__);
memcpy(sdu->data, sdu_buffer_pP, sdu_buffer_sizeP); memcpy(sdu->data, sdu_buffer_pP, sdu_buffer_sizeP);
...@@ -704,7 +704,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, ...@@ -704,7 +704,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
LOG_E(F1AP,"Not found rnti: %x\n", rnti); LOG_E(F1AP,"Not found rnti: %x\n", rnti);
} else { } else {
for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) { for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
if (RC.mac[instance]->UE_info.active[n] == TRUE if (RC.mac[instance]->UE_info.active[n] == true
&& rnti == UE_RNTI(instance, n)) { && rnti == UE_RNTI(instance, n)) {
UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync; UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync;
break; break;
...@@ -856,7 +856,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, ...@@ -856,7 +856,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
if(RC.rrc && RC.rrc[instance]->node_type == ngran_eNB_DU){ if(RC.rrc && RC.rrc[instance]->node_type == ngran_eNB_DU){
for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) { for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
if (RC.mac[instance]->UE_info.active[n] == TRUE if (RC.mac[instance]->UE_info.active[n] == true
&& rnti == UE_RNTI(instance, n)) { && rnti == UE_RNTI(instance, n)) {
UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync; UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync;
break; break;
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
{CONFIG_STRING_MACRLC_ULSCH_MAX_FRAME_INACTIVITY, NULL, 0, uptr:NULL, defintval:10, TYPE_UINT, 0}, \ {CONFIG_STRING_MACRLC_ULSCH_MAX_FRAME_INACTIVITY, NULL, 0, uptr:NULL, defintval:10, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_PUSCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \ {CONFIG_STRING_MACRLC_PUSCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
{CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:150, TYPE_INT, 0}, \ {CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:150, TYPE_INT, 0}, \
{CONFIG_STRING_MACRLC_UL_PRBBLACK_SNR_THRESHOLD, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \ {CONFIG_STRING_MACRLC_UL_PRBBLACK_SNR_THRESHOLD, "SNR threshold to decide whether a PRB will be blacklisted or not", 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
{CONFIG_STRING_MACRLC_PUCCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \ {CONFIG_STRING_MACRLC_PUCCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
{CONFIG_STRING_MACRLC_PUSCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \ {CONFIG_STRING_MACRLC_PUSCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
{CONFIG_STRING_MACRLC_DL_BLER_TARGET_UPPER, "Upper threshold of BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.15, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_BLER_TARGET_UPPER, "Upper threshold of BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.15, TYPE_DOUBLE, 0}, \
......
...@@ -1104,7 +1104,7 @@ void eNB_Config_Local_DRX(instance_t Mod_id, ...@@ -1104,7 +1104,7 @@ void eNB_Config_Local_DRX(instance_t Mod_id,
/* Get struct to modify */ /* Get struct to modify */
UE_scheduling_control = &(UE_info_mac->UE_sched_ctrl[UE_id]); UE_scheduling_control = &(UE_info_mac->UE_sched_ctrl[UE_id]);
UE_scheduling_control->cdrx_configured = FALSE; // will be set to true when no error UE_scheduling_control->cdrx_configured = false; // will be set to true when no error
/* Check drx_Configuration */ /* Check drx_Configuration */
if (drx_Configuration == NULL) { if (drx_Configuration == NULL) {
...@@ -1119,9 +1119,9 @@ void eNB_Config_Local_DRX(instance_t Mod_id, ...@@ -1119,9 +1119,9 @@ void eNB_Config_Local_DRX(instance_t Mod_id,
} }
/* Modify scheduling control structure according to DRX configuration: doesn't support every configurations! */ /* Modify scheduling control structure according to DRX configuration: doesn't support every configurations! */
UE_scheduling_control->cdrx_configured = FALSE; // will be set to true when receiving RRC Reconfiguration Complete UE_scheduling_control->cdrx_configured = false; // will be set to true when receiving RRC Reconfiguration Complete
UE_scheduling_control->cdrx_waiting_ack = TRUE; // waiting for RRC Reconfiguration Complete message UE_scheduling_control->cdrx_waiting_ack = true; // waiting for RRC Reconfiguration Complete message
UE_scheduling_control->in_active_time = FALSE; UE_scheduling_control->in_active_time = false;
UE_scheduling_control->dci0_ongoing_timer = 0; UE_scheduling_control->dci0_ongoing_timer = 0;
UE_scheduling_control->on_duration_timer = 0; UE_scheduling_control->on_duration_timer = 0;
struct LTE_DRX_Config__setup *choiceSetup = &drx_Configuration->choice.setup; struct LTE_DRX_Config__setup *choiceSetup = &drx_Configuration->choice.setup;
...@@ -1297,13 +1297,13 @@ void eNB_Config_Local_DRX(instance_t Mod_id, ...@@ -1297,13 +1297,13 @@ void eNB_Config_Local_DRX(instance_t Mod_id,
} }
if (choiceSetup->shortDRX == NULL) { if (choiceSetup->shortDRX == NULL) {
UE_scheduling_control->in_short_drx_cycle = FALSE; UE_scheduling_control->in_short_drx_cycle = false;
UE_scheduling_control->drx_shortCycle_timer_value = 0; UE_scheduling_control->drx_shortCycle_timer_value = 0;
UE_scheduling_control->short_drx_cycle_duration = 0; UE_scheduling_control->short_drx_cycle_duration = 0;
UE_scheduling_control->drx_shortCycle_timer = 0; UE_scheduling_control->drx_shortCycle_timer = 0;
UE_scheduling_control->drx_shortCycle_timer_thres = -1; UE_scheduling_control->drx_shortCycle_timer_thres = -1;
} else { } else {
UE_scheduling_control->in_short_drx_cycle = FALSE; UE_scheduling_control->in_short_drx_cycle = false;
UE_scheduling_control->drx_shortCycle_timer_value = (uint8_t) choiceSetup->shortDRX->drxShortCycleTimer; UE_scheduling_control->drx_shortCycle_timer_value = (uint8_t) choiceSetup->shortDRX->drxShortCycleTimer;
switch (choiceSetup->shortDRX->shortDRX_Cycle) { switch (choiceSetup->shortDRX->shortDRX_Cycle) {
...@@ -1380,7 +1380,7 @@ void eNB_Config_Local_DRX(instance_t Mod_id, ...@@ -1380,7 +1380,7 @@ void eNB_Config_Local_DRX(instance_t Mod_id,
UE_scheduling_control->drx_shortCycle_timer_thres = UE_scheduling_control->drx_shortCycle_timer_value * UE_scheduling_control->short_drx_cycle_duration; UE_scheduling_control->drx_shortCycle_timer_thres = UE_scheduling_control->drx_shortCycle_timer_value * UE_scheduling_control->short_drx_cycle_duration;
} }
UE_scheduling_control->in_long_drx_cycle = FALSE; UE_scheduling_control->in_long_drx_cycle = false;
UE_scheduling_control->drx_longCycle_timer = 0; UE_scheduling_control->drx_longCycle_timer = 0;
switch (choiceSetup->longDRX_CycleStartOffset.present) { switch (choiceSetup->longDRX_CycleStartOffset.present) {
......
...@@ -243,7 +243,6 @@ typedef struct { ...@@ -243,7 +243,6 @@ typedef struct {
// -1:No UE in list // -1:No UE in list
int tail; int tail;
int num_UEs; int num_UEs;
//boolean_t active[MAX_MAX_MOBILES_PER_ENB_NB_IoT];
} UE_list_NB_IoT_t; } UE_list_NB_IoT_t;
...@@ -403,7 +402,7 @@ typedef struct schedule_result{ ...@@ -403,7 +402,7 @@ typedef struct schedule_result{
// pointer to DCI // pointer to DCI
void *DCI_pdu; void *DCI_pdu;
// when all the procedure related to this DCI, enable this flag // when all the procedure related to this DCI, enable this flag
boolean_t DCI_release; bool DCI_release;
// Indicate the channel which to transmit // Indicate the channel which to transmit
channel_NB_IoT_t channel; channel_NB_IoT_t channel;
// rnti // rnti
...@@ -452,7 +451,7 @@ typedef enum ce_level_e{ ...@@ -452,7 +451,7 @@ typedef enum ce_level_e{
/*! \brief eNB template for the Random access information */ /*! \brief eNB template for the Random access information */
typedef struct RA_TEMPLATE_NB_IoT_s{ typedef struct RA_TEMPLATE_NB_IoT_s{
boolean_t active; bool active;
uint32_t msg3_retransmit_count; uint32_t msg3_retransmit_count;
uint32_t msg4_retransmit_count; uint32_t msg4_retransmit_count;
uint16_t ta; uint16_t ta;
...@@ -461,8 +460,8 @@ typedef struct RA_TEMPLATE_NB_IoT_s{ ...@@ -461,8 +460,8 @@ typedef struct RA_TEMPLATE_NB_IoT_s{
rnti_t ue_rnti; rnti_t ue_rnti;
rnti_t ra_rnti; rnti_t ra_rnti;
struct RA_TEMPLATE_NB_IoT_s *next, *prev; struct RA_TEMPLATE_NB_IoT_s *next, *prev;
boolean_t wait_msg4_ack; bool wait_msg4_ack;
boolean_t wait_msg3_ack; bool wait_msg3_ack;
uint8_t rar_buffer[7]; uint8_t rar_buffer[7];
} RA_TEMPLATE_NB_IoT; } RA_TEMPLATE_NB_IoT;
...@@ -530,7 +529,7 @@ typedef struct { ...@@ -530,7 +529,7 @@ typedef struct {
uint32_t pdus_in_buffer; /*!< \brief Number of PDUs buffered in RLC protocol instance (OBSOLETE). */ uint32_t pdus_in_buffer; /*!< \brief Number of PDUs buffered in RLC protocol instance (OBSOLETE). */
uint32_t head_sdu_creation_time; /*!< \brief Head SDU creation time. */ uint32_t head_sdu_creation_time; /*!< \brief Head SDU creation time. */
uint32_t head_sdu_remaining_size_to_send; /*!< \brief remaining size of sdu: could be the total size or the remaining size of already segmented sdu */ uint32_t head_sdu_remaining_size_to_send; /*!< \brief remaining size of sdu: could be the total size or the remaining size of already segmented sdu */
boolean_t head_sdu_is_segmented; /*!< \brief 0 if head SDU has not been segmented, 1 if already segmented */ bool head_sdu_is_segmented; /*!< \brief 0 if head SDU has not been segmented, 1 if already segmented */
} mac_rlc_status_resp_NB_IoT_t; } mac_rlc_status_resp_NB_IoT_t;
// global variables // global variables
......
...@@ -135,7 +135,7 @@ void schedule_SRS(module_id_t module_idP, ...@@ -135,7 +135,7 @@ void schedule_SRS(module_id_t module_idP,
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]); UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
/* Test if Active Time not running since 6+ subframes */ /* Test if Active Time not running since 6+ subframes */
if (UE_scheduling_control->cdrx_configured == TRUE && UE_scheduling_control->in_active_time == FALSE) { if (UE_scheduling_control->cdrx_configured == true && UE_scheduling_control->in_active_time == false) {
/* /*
* TODO: 6+ subframes condition not checked here * TODO: 6+ subframes condition not checked here
*/ */
...@@ -204,7 +204,7 @@ void schedule_CSI(module_id_t module_idP, ...@@ -204,7 +204,7 @@ void schedule_CSI(module_id_t module_idP,
cc = &eNB->common_channels[CC_id]; cc = &eNB->common_channels[CC_id];
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (UE_info->active[UE_id] == FALSE) { if (UE_info->active[UE_id] == false) {
continue; continue;
} }
...@@ -223,9 +223,9 @@ void schedule_CSI(module_id_t module_idP, ...@@ -223,9 +223,9 @@ void schedule_CSI(module_id_t module_idP,
*/ */
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]); UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
if (UE_scheduling_control->cdrx_configured == TRUE) { if (UE_scheduling_control->cdrx_configured == true) {
/* Test if CQI masking activated */ /* Test if CQI masking activated */
if (UE_scheduling_control->cqi_mask_boolean == TRUE) { if (UE_scheduling_control->cqi_mask_boolean == true) {
// CQI masking => test if onDurationTime not running since 6+ subframe // CQI masking => test if onDurationTime not running since 6+ subframe
if (UE_scheduling_control->on_duration_timer == 0) { if (UE_scheduling_control->on_duration_timer == 0) {
/* /*
...@@ -234,7 +234,7 @@ void schedule_CSI(module_id_t module_idP, ...@@ -234,7 +234,7 @@ void schedule_CSI(module_id_t module_idP,
continue; continue;
} }
} else { // No CQI masking => test if Active Time not running since 6+ subframe } else { // No CQI masking => test if Active Time not running since 6+ subframe
if (UE_scheduling_control->in_active_time == FALSE) { if (UE_scheduling_control->in_active_time == false) {
/* /*
* TODO: 6+ subframes condition not checked here * TODO: 6+ subframes condition not checked here
*/ */
...@@ -677,8 +677,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -677,8 +677,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
/* Set and increment CDRX related timers */ /* Set and increment CDRX related timers */
if (UE_scheduling_control->cdrx_configured == TRUE) { if (UE_scheduling_control->cdrx_configured == true) {
boolean_t harq_active_time_condition = FALSE; bool harq_active_time_condition = false;
UE_TEMPLATE *UE_template = NULL; UE_TEMPLATE *UE_template = NULL;
unsigned long active_time_condition = 0; // variable used only for tracing purpose unsigned long active_time_condition = 0; // variable used only for tracing purpose
...@@ -721,7 +721,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -721,7 +721,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id]++; UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id]++;
if (UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id] > 5) { if (UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id] > 5) {
harq_active_time_condition = TRUE; harq_active_time_condition = true;
UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id] = 0; UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id] = 0;
active_time_condition = 5; // for tracing purpose active_time_condition = 5; // for tracing purpose
} }
...@@ -747,24 +747,24 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -747,24 +747,24 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
/* When timer expires switch into short or long DRX cycle */ /* When timer expires switch into short or long DRX cycle */
if (UE_scheduling_control->drx_shortCycle_timer_thres > 0) { if (UE_scheduling_control->drx_shortCycle_timer_thres > 0) {
UE_scheduling_control->in_short_drx_cycle = TRUE; UE_scheduling_control->in_short_drx_cycle = true;
UE_scheduling_control->drx_shortCycle_timer = 0; UE_scheduling_control->drx_shortCycle_timer = 0;
UE_scheduling_control->in_long_drx_cycle = FALSE; UE_scheduling_control->in_long_drx_cycle = false;
} else { } else {
UE_scheduling_control->in_long_drx_cycle = TRUE; UE_scheduling_control->in_long_drx_cycle = true;
} }
} }
} }
/* Short DRX Cycle */ /* Short DRX Cycle */
if (UE_scheduling_control->in_short_drx_cycle == TRUE) { if (UE_scheduling_control->in_short_drx_cycle == true) {
UE_scheduling_control->drx_shortCycle_timer++; UE_scheduling_control->drx_shortCycle_timer++;
/* When the Short DRX cycles are over, switch to long DRX cycle */ /* When the Short DRX cycles are over, switch to long DRX cycle */
if (UE_scheduling_control->drx_shortCycle_timer > UE_scheduling_control->drx_shortCycle_timer_thres) { if (UE_scheduling_control->drx_shortCycle_timer > UE_scheduling_control->drx_shortCycle_timer_thres) {
UE_scheduling_control->drx_shortCycle_timer = 0; UE_scheduling_control->drx_shortCycle_timer = 0;
UE_scheduling_control->in_short_drx_cycle = FALSE; UE_scheduling_control->in_short_drx_cycle = false;
UE_scheduling_control->in_long_drx_cycle = TRUE; UE_scheduling_control->in_long_drx_cycle = true;
UE_scheduling_control->drx_longCycle_timer = 0; UE_scheduling_control->drx_longCycle_timer = 0;
} }
} else { } else {
...@@ -772,7 +772,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -772,7 +772,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
/* Long DRX Cycle */ /* Long DRX Cycle */
if (UE_scheduling_control->in_long_drx_cycle == TRUE) { if (UE_scheduling_control->in_long_drx_cycle == true) {
UE_scheduling_control->drx_longCycle_timer++; UE_scheduling_control->drx_longCycle_timer++;
if (UE_scheduling_control->drx_longCycle_timer > UE_scheduling_control->drx_longCycle_timer_thres) { if (UE_scheduling_control->drx_longCycle_timer > UE_scheduling_control->drx_longCycle_timer_thres) {
...@@ -783,18 +783,18 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -783,18 +783,18 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
/* Check for error cases */ /* Check for error cases */
if ((UE_scheduling_control->in_short_drx_cycle == TRUE) && (UE_scheduling_control->in_long_drx_cycle == TRUE)) { if ((UE_scheduling_control->in_short_drx_cycle == true) && (UE_scheduling_control->in_long_drx_cycle == true)) {
LOG_E(MAC, "Error in C-DRX: UE id %d is in both short and long DRX cycle. Should not happen. Back it to long cycle only\n", UE_id); LOG_E(MAC, "Error in C-DRX: UE id %d is in both short and long DRX cycle. Should not happen. Back it to long cycle only\n", UE_id);
UE_scheduling_control->in_short_drx_cycle = FALSE; UE_scheduling_control->in_short_drx_cycle = false;
} }
/* Condition to start On Duration Timer */ /* Condition to start On Duration Timer */
if (UE_scheduling_control->in_short_drx_cycle == TRUE && UE_scheduling_control->on_duration_timer == 0) { if (UE_scheduling_control->in_short_drx_cycle == true && UE_scheduling_control->on_duration_timer == 0) {
if (((frameP * 10) + subframeP) % (UE_scheduling_control->short_drx_cycle_duration) == if (((frameP * 10) + subframeP) % (UE_scheduling_control->short_drx_cycle_duration) ==
(UE_scheduling_control->drx_start_offset) % (UE_scheduling_control->short_drx_cycle_duration)) { (UE_scheduling_control->drx_start_offset) % (UE_scheduling_control->short_drx_cycle_duration)) {
UE_scheduling_control->on_duration_timer = 1; UE_scheduling_control->on_duration_timer = 1;
} }
} else if (UE_scheduling_control->in_long_drx_cycle == TRUE && UE_scheduling_control->on_duration_timer == 0) { } else if (UE_scheduling_control->in_long_drx_cycle == true && UE_scheduling_control->on_duration_timer == 0) {
if (((frameP * 10) + subframeP) % (UE_scheduling_control->drx_longCycle_timer_thres) == if (((frameP * 10) + subframeP) % (UE_scheduling_control->drx_longCycle_timer_thres) ==
(UE_scheduling_control->drx_start_offset)) { (UE_scheduling_control->drx_start_offset)) {
UE_scheduling_control->on_duration_timer = 1; UE_scheduling_control->on_duration_timer = 1;
...@@ -811,7 +811,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -811,7 +811,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
/* (a)synchronous HARQ processes handling for Active Time */ /* (a)synchronous HARQ processes handling for Active Time */
for (int harq_process_id = 0; harq_process_id < 8; harq_process_id++) { for (int harq_process_id = 0; harq_process_id < 8; harq_process_id++) {
if (UE_scheduling_control->drx_retransmission_timer[harq_process_id] > 0) { if (UE_scheduling_control->drx_retransmission_timer[harq_process_id] > 0) {
harq_active_time_condition = TRUE; harq_active_time_condition = true;
active_time_condition = 2; // for tracing purpose active_time_condition = 2; // for tracing purpose
break; break;
} }
...@@ -822,9 +822,9 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -822,9 +822,9 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
UE_scheduling_control->drx_inactivity_timer > 1 || UE_scheduling_control->drx_inactivity_timer > 1 ||
harq_active_time_condition || harq_active_time_condition ||
UE_template->ul_SR > 0) { UE_template->ul_SR > 0) {
UE_scheduling_control->in_active_time = TRUE; UE_scheduling_control->in_active_time = true;
} else { } else {
UE_scheduling_control->in_active_time = FALSE; UE_scheduling_control->in_active_time = false;
} }
/* BEGIN VCD */ /* BEGIN VCD */
......
...@@ -1225,7 +1225,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP, ...@@ -1225,7 +1225,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:IDLE\n", module_idP, frameP, subframeP); LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:IDLE\n", module_idP, frameP, subframeP);
UE_id = find_UE_id(module_idP, ra->rnti); UE_id = find_UE_id(module_idP, ra->rnti);
DevAssert(UE_id != -1); DevAssert(UE_id != -1);
mac->UE_info.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].configured = TRUE; mac->UE_info.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].configured = true;
mac->UE_info.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].pusch_repetition_levels=ra->pusch_repetition_levels; mac->UE_info.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].pusch_repetition_levels=ra->pusch_repetition_levels;
cancel_ra_proc(module_idP, CC_idP, frameP, ra->rnti); cancel_ra_proc(module_idP, CC_idP, frameP, ra->rnti);
} }
......
...@@ -2075,7 +2075,7 @@ schedule_PCH(module_id_t module_idP, ...@@ -2075,7 +2075,7 @@ schedule_PCH(module_id_t module_idP,
for (uint16_t i = 0; i < MAX_MOBILES_PER_ENB; i++) { for (uint16_t i = 0; i < MAX_MOBILES_PER_ENB; i++) {
ue_pf_po = &UE_PF_PO[CC_id][i]; ue_pf_po = &UE_PF_PO[CC_id][i];
if (ue_pf_po->enable_flag != TRUE) { if (ue_pf_po->enable_flag != true) {
continue; continue;
} }
......
...@@ -69,7 +69,7 @@ int last_ulsch_ue_id_volte[MAX_NUM_CCs] = {-1}; ...@@ -69,7 +69,7 @@ int last_ulsch_ue_id_volte[MAX_NUM_CCs] = {-1};
uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX];
uint8_t dlsch_ue_select_tbl_in_use; uint8_t dlsch_ue_select_tbl_in_use;
uint8_t new_dlsch_ue_select_tbl_in_use; uint8_t new_dlsch_ue_select_tbl_in_use;
boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX]; bool pre_scd_activeUE[NUMBER_OF_UE_MAX];
eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
#endif #endif
...@@ -125,7 +125,7 @@ void pre_scd_nb_rbs_required( module_id_t module_idP, ...@@ -125,7 +125,7 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
UE_info_t *UE_info = &RC.mac[module_idP]->UE_info; UE_info_t *UE_info = &RC.mac[module_idP]->UE_info;
for (UE_id = 0; UE_id <NUMBER_OF_UE_MAX; UE_id++) { for (UE_id = 0; UE_id <NUMBER_OF_UE_MAX; UE_id++) {
if (pre_scd_activeUE[UE_id] != TRUE) if (pre_scd_activeUE[UE_id] != true)
continue; continue;
// store dlsch buffer // store dlsch buffer
...@@ -210,7 +210,7 @@ void dlsch_scheduler_pre_ue_select_fairRR( ...@@ -210,7 +210,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
DL_req = &eNB->DL_req[CC_id].dl_config_request_body; DL_req = &eNB->DL_req[CC_id].dl_config_request_body;
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
if (UE_info->active[UE_id] == FALSE) { if (UE_info->active[UE_id] == false) {
continue; continue;
} }
...@@ -331,7 +331,7 @@ void dlsch_scheduler_pre_ue_select_fairRR( ...@@ -331,7 +331,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
break; break;
} }
if (UE_info->active[UE_id] == FALSE) { if (UE_info->active[UE_id] == false) {
continue; continue;
} }
...@@ -459,7 +459,7 @@ void dlsch_scheduler_pre_ue_select_fairRR( ...@@ -459,7 +459,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
break; break;
} }
if (UE_info->active[UE_id] == FALSE) { if (UE_info->active[UE_id] == false) {
continue; continue;
} }
...@@ -607,7 +607,7 @@ static void dlsch_scheduler_pre_processor_reset_fairRR( ...@@ -607,7 +607,7 @@ static void dlsch_scheduler_pre_processor_reset_fairRR(
if (rnti == NOT_A_RNTI) if (rnti == NOT_A_RNTI)
continue; continue;
if (UE_info->active[UE_id] != TRUE) if (UE_info->active[UE_id] != true)
continue; continue;
LOG_D(MAC, "Running preprocessor for UE %d (%x)\n", UE_id, rnti); LOG_D(MAC, "Running preprocessor for UE %d (%x)\n", UE_id, rnti);
...@@ -755,7 +755,7 @@ static void assign_rbs_required_fairRR( ...@@ -755,7 +755,7 @@ static void assign_rbs_required_fairRR(
// clear rb allocations across all CC_id // clear rb allocations across all CC_id
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (UE_info->active[UE_id] != TRUE) if (UE_info->active[UE_id] != true)
continue; continue;
pCCid = UE_PCCID(Mod_id, UE_id); pCCid = UE_PCCID(Mod_id, UE_id);
...@@ -945,7 +945,7 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -945,7 +945,7 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
min_rb_unit[CC_id] = get_min_rb_unit(Mod_id, CC_id); min_rb_unit[CC_id] = get_min_rb_unit(Mod_id, CC_id);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) { for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (UE_info->active[i] != TRUE) if (UE_info->active[i] != true)
continue; continue;
UE_id = i; UE_id = i;
...@@ -2241,7 +2241,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( ...@@ -2241,7 +2241,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
// UE round >0 // UE round >0
for ( UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++ ) { for ( UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++ ) {
if (UE_info->active[UE_id] == FALSE) if (UE_info->active[UE_id] == false)
continue; continue;
rnti = UE_RNTI(module_idP,UE_id); rnti = UE_RNTI(module_idP,UE_id);
...@@ -2251,7 +2251,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( ...@@ -2251,7 +2251,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
CC_id = UE_PCCID(module_idP,UE_id); CC_id = UE_PCCID(module_idP,UE_id);
if (UE_info->UE_template[CC_id][UE_id].configured == FALSE) if (UE_info->UE_template[CC_id][UE_id].configured == false)
continue; continue;
if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0
...@@ -2401,7 +2401,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( ...@@ -2401,7 +2401,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
} }
for ( UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++ ) { for ( UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++ ) {
if (UE_info->active[UE_id] == FALSE) if (UE_info->active[UE_id] == false)
continue; continue;
rnti = UE_RNTI(module_idP,UE_id); rnti = UE_RNTI(module_idP,UE_id);
...@@ -2414,7 +2414,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( ...@@ -2414,7 +2414,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
if (UE_id > last_ulsch_ue_id[CC_id]) if (UE_id > last_ulsch_ue_id[CC_id])
continue; continue;
if (UE_info->UE_template[CC_id][UE_id].configured == FALSE) if (UE_info->UE_template[CC_id][UE_id].configured == false)
continue; continue;
if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0
......
...@@ -1989,7 +1989,7 @@ find_UE_id(module_id_t mod_idP, ...@@ -1989,7 +1989,7 @@ find_UE_id(module_id_t mod_idP,
return -1; return -1;
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (UE_info->active[UE_id] == TRUE) { if (UE_info->active[UE_id] == true) {
int CC_id = UE_PCCID(mod_idP, UE_id); int CC_id = UE_PCCID(mod_idP, UE_id);
if (CC_id>=0 && CC_id<NFAPI_CC_MAX && UE_info->UE_template[CC_id][UE_id].rnti == rntiP) { if (CC_id>=0 && CC_id<NFAPI_CC_MAX && UE_info->UE_template[CC_id][UE_id].rnti == rntiP) {
return UE_id; return UE_id;
...@@ -2063,7 +2063,7 @@ UE_RNTI(module_id_t mod_idP, ...@@ -2063,7 +2063,7 @@ UE_RNTI(module_id_t mod_idP,
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
boolean_t bool
is_UE_active(module_id_t mod_idP, is_UE_active(module_id_t mod_idP,
int ue_idP) int ue_idP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -2187,20 +2187,20 @@ add_new_ue(module_id_t mod_idP, ...@@ -2187,20 +2187,20 @@ add_new_ue(module_id_t mod_idP,
UE_info->num_UEs); UE_info->num_UEs);
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_info->active[i] == TRUE) if (UE_info->active[i] == true)
continue; continue;
UE_id = i; UE_id = i;
memset(&UE_info->UE_template[cc_idP][UE_id], 0, sizeof(UE_TEMPLATE)); memset(&UE_info->UE_template[cc_idP][UE_id], 0, sizeof(UE_TEMPLATE));
UE_info->UE_template[cc_idP][UE_id].rnti = rntiP; UE_info->UE_template[cc_idP][UE_id].rnti = rntiP;
UE_info->UE_template[cc_idP][UE_id].configured = FALSE; UE_info->UE_template[cc_idP][UE_id].configured = false;
UE_info->numactiveCCs[UE_id] = 1; UE_info->numactiveCCs[UE_id] = 1;
UE_info->numactiveULCCs[UE_id] = 1; UE_info->numactiveULCCs[UE_id] = 1;
UE_info->pCC_id[UE_id] = cc_idP; UE_info->pCC_id[UE_id] = cc_idP;
UE_info->ordered_CCids[0][UE_id] = cc_idP; UE_info->ordered_CCids[0][UE_id] = cc_idP;
UE_info->ordered_ULCCids[0][UE_id] = cc_idP; UE_info->ordered_ULCCids[0][UE_id] = cc_idP;
UE_info->num_UEs++; UE_info->num_UEs++;
UE_info->active[UE_id] = TRUE; UE_info->active[UE_id] = true;
add_ue_list(&UE_info->list, UE_id); add_ue_list(&UE_info->list, UE_id);
dump_ue_list(&UE_info->list); dump_ue_list(&UE_info->list);
pp_impl_param_t* dl = &RC.mac[mod_idP]->pre_processor_dl; pp_impl_param_t* dl = &RC.mac[mod_idP]->pre_processor_dl;
...@@ -2280,7 +2280,7 @@ rrc_mac_remove_ue(module_id_t mod_idP, ...@@ -2280,7 +2280,7 @@ rrc_mac_remove_ue(module_id_t mod_idP,
UE_id, UE_id,
pCC_id, pCC_id,
rntiP); rntiP);
UE_info->active[UE_id] = FALSE; UE_info->active[UE_id] = false;
UE_info->num_UEs--; UE_info->num_UEs--;
remove_ue_list(&UE_info->list, UE_id); remove_ue_list(&UE_info->list, UE_id);
...@@ -3488,7 +3488,7 @@ has_ul_grant(module_id_t module_idP, ...@@ -3488,7 +3488,7 @@ has_ul_grant(module_id_t module_idP,
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
boolean_t bool
CCE_allocation_infeasible(int module_idP, CCE_allocation_infeasible(int module_idP,
int CC_idP, int CC_idP,
int format_flag, int format_flag,
...@@ -3501,7 +3501,7 @@ CCE_allocation_infeasible(int module_idP, ...@@ -3501,7 +3501,7 @@ CCE_allocation_infeasible(int module_idP,
nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu]; nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu];
nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP][subframe].hi_dci0_request_body; nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP][subframe].hi_dci0_request_body;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi]; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi];
boolean_t res = TRUE; bool res = true;
if (format_flag != 2) { // DL DCI if (format_flag != 2) { // DL DCI
if (DL_req->number_pdu == MAX_NUM_DL_PDU) { if (DL_req->number_pdu == MAX_NUM_DL_PDU) {
...@@ -3517,7 +3517,7 @@ CCE_allocation_infeasible(int module_idP, ...@@ -3517,7 +3517,7 @@ CCE_allocation_infeasible(int module_idP,
subframe, format_flag, rnti, aggregation); subframe, format_flag, rnti, aggregation);
if (allocate_CCEs(module_idP, CC_idP, 0, subframe, 0) != -1) if (allocate_CCEs(module_idP, CC_idP, 0, subframe, 0) != -1)
res = FALSE; res = false;
DL_req->number_pdu--; DL_req->number_pdu--;
} }
...@@ -3532,7 +3532,7 @@ CCE_allocation_infeasible(int module_idP, ...@@ -3532,7 +3532,7 @@ CCE_allocation_infeasible(int module_idP,
HI_DCI0_req->number_of_dci++; HI_DCI0_req->number_of_dci++;
if (allocate_CCEs(module_idP, CC_idP, 0, subframe, 0) != -1) if (allocate_CCEs(module_idP, CC_idP, 0, subframe, 0) != -1)
res = FALSE; res = false;
HI_DCI0_req->number_of_dci--; HI_DCI0_req->number_of_dci--;
} }
...@@ -5029,7 +5029,7 @@ SR_indication(module_id_t mod_idP, ...@@ -5029,7 +5029,7 @@ SR_indication(module_id_t mod_idP,
if (UE_id != -1) { if (UE_id != -1) {
UE_scheduling_ctrl = &(UE_info->UE_sched_ctrl[UE_id]); UE_scheduling_ctrl = &(UE_info->UE_sched_ctrl[UE_id]);
if ((UE_scheduling_ctrl->cdrx_configured == TRUE) && if ((UE_scheduling_ctrl->cdrx_configured == true) &&
(UE_scheduling_ctrl->dci0_ongoing_timer > 0) && (UE_scheduling_ctrl->dci0_ongoing_timer > 0) &&
(UE_scheduling_ctrl->dci0_ongoing_timer < 8)) { (UE_scheduling_ctrl->dci0_ongoing_timer < 8)) {
LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d. \ LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d. \
...@@ -5052,7 +5052,7 @@ SR_indication(module_id_t mod_idP, ...@@ -5052,7 +5052,7 @@ SR_indication(module_id_t mod_idP,
} }
UE_info->UE_template[cc_idP][UE_id].ul_SR = 1; UE_info->UE_template[cc_idP][UE_id].ul_SR = 1;
UE_info->UE_template[cc_idP][UE_id].ul_active = TRUE; UE_info->UE_template[cc_idP][UE_id].ul_active = true;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 0);
} }
......
...@@ -242,7 +242,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -242,7 +242,7 @@ rx_sdu(const module_id_t enb_mod_idP,
} }
/* CDRX UL HARQ timers */ /* CDRX UL HARQ timers */
if (UE_scheduling_control->cdrx_configured == TRUE) { if (UE_scheduling_control->cdrx_configured == true) {
/* Synchronous UL HARQ */ /* Synchronous UL HARQ */
UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5; UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5;
/* /*
...@@ -1003,7 +1003,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -1003,7 +1003,7 @@ rx_sdu(const module_id_t enb_mod_idP,
/* CDRX UL HARQ timers */ /* CDRX UL HARQ timers */
if (UE_id != -1) { if (UE_id != -1) {
if (UE_scheduling_control->cdrx_configured == TRUE) { if (UE_scheduling_control->cdrx_configured == true) {
/* Synchronous UL HARQ */ /* Synchronous UL HARQ */
UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5; UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5;
/* /*
...@@ -1447,7 +1447,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1447,7 +1447,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
continue; continue;
// don't schedule if Msg5 is not received yet // don't schedule if Msg5 is not received yet
if (UE_info->UE_template[CC_id][UE_id].configured == FALSE) { if (UE_info->UE_template[CC_id][UE_id].configured == false) {
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] frame %d, subframe %d, UE %d: not configured, skipping " "[eNB %d] frame %d, subframe %d, UE %d: not configured, skipping "
"UE scheduling \n", "UE scheduling \n",
...@@ -2033,7 +2033,7 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP, ...@@ -2033,7 +2033,7 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP,
} }
/* Don't schedule if Msg4 is not received yet */ /* Don't schedule if Msg4 is not received yet */
if (UE_template->configured == FALSE) { if (UE_template->configured == false) {
LOG_D(MAC,"[eNB %d] frame %d subframe %d, UE %d: not configured, skipping UE scheduling \n", LOG_D(MAC,"[eNB %d] frame %d subframe %d, UE %d: not configured, skipping UE scheduling \n",
module_idP, module_idP,
frameP, frameP,
......
...@@ -811,9 +811,9 @@ typedef struct { ...@@ -811,9 +811,9 @@ typedef struct {
/// TBS from last UL scheduling /// TBS from last UL scheduling
int TBS_UL[8]; int TBS_UL[8];
/// Flag to indicate UL has been scheduled at least once /// Flag to indicate UL has been scheduled at least once
boolean_t ul_active; bool ul_active;
/// Flag to indicate UE has been configured (ACK from RRCConnectionSetup received) /// Flag to indicate UE has been configured (ACK from RRCConnectionSetup received)
boolean_t configured; bool configured;
/// MCS from last scheduling /// MCS from last scheduling
uint8_t mcs[8]; uint8_t mcs[8];
...@@ -1026,16 +1026,16 @@ typedef struct { ...@@ -1026,16 +1026,16 @@ typedef struct {
/* C-DRX related timers */ /* C-DRX related timers */
/* Note: only valid for FDD and LTE UE when this comment is written (11-01-19)*/ /* Note: only valid for FDD and LTE UE when this comment is written (11-01-19)*/
/// is TRUE if the cqi mask feature is activated by RRC configuration /// is true if the cqi mask feature is activated by RRC configuration
boolean_t cqi_mask_boolean; bool cqi_mask_boolean;
/// is TRUE if the following drx parameters are configured for UE /// is true if the following drx parameters are configured for UE
boolean_t cdrx_configured; bool cdrx_configured;
/* /*
* if TRUE, the eNB has configured the CDRX locally, but is waiting for the UE to acknowledge * if true, the eNB has configured the CDRX locally, but is waiting for the UE to acknowledge
* the activation. This is needed, during the RRC configuration process, when the context is * the activation. This is needed, during the RRC configuration process, when the context is
* configured on the eNB side, but not yet on the UE side... * configured on the eNB side, but not yet on the UE side...
*/ */
boolean_t cdrx_waiting_ack; bool cdrx_waiting_ack;
/* /*
* Is set when a ULSCH scheduling is done and run until the first corresponding transmission is done (4 subframes). * Is set when a ULSCH scheduling is done and run until the first corresponding transmission is done (4 subframes).
* When set, SR cannot be set for the UE. This allows OAI to avoid concidering a SR as uncompleted if the UE sends * When set, SR cannot be set for the UE. This allows OAI to avoid concidering a SR as uncompleted if the UE sends
...@@ -1043,16 +1043,16 @@ typedef struct { ...@@ -1043,16 +1043,16 @@ typedef struct {
* create a lost in timers synchronization. * create a lost in timers synchronization.
*/ */
uint8_t dci0_ongoing_timer; uint8_t dci0_ongoing_timer;
/// is TRUE if the UE is in "Active Time", hence listening to PDCCH /// is true if the UE is in "Active Time", hence listening to PDCCH
boolean_t in_active_time; bool in_active_time;
/// OnDurationTimer /// OnDurationTimer
uint16_t on_duration_timer; uint16_t on_duration_timer;
uint16_t on_duration_timer_thres; uint16_t on_duration_timer_thres;
/// drx-InactivityTimer /// drx-InactivityTimer
uint16_t drx_inactivity_timer; uint16_t drx_inactivity_timer;
uint16_t drx_inactivity_timer_thres; uint16_t drx_inactivity_timer_thres;
/// is TRUE if UE is currently in short DRX cycle /// is true if UE is currently in short DRX cycle
boolean_t in_short_drx_cycle; bool in_short_drx_cycle;
/// drxShortCycleTimer int (1..16) (number of short DRX cycles duration before long DRX cycles) /// drxShortCycleTimer int (1..16) (number of short DRX cycles duration before long DRX cycles)
uint8_t drx_shortCycle_timer_value; uint8_t drx_shortCycle_timer_value;
/// shortDRX-Cycle (duration of one short DRX cycle) /// shortDRX-Cycle (duration of one short DRX cycle)
...@@ -1060,8 +1060,8 @@ typedef struct { ...@@ -1060,8 +1060,8 @@ typedef struct {
/// DRX short cycle timer before switching to long DRX cycle = drx_shortCycle_timer_value * short_drx_cycle_duration /// DRX short cycle timer before switching to long DRX cycle = drx_shortCycle_timer_value * short_drx_cycle_duration
uint16_t drx_shortCycle_timer; uint16_t drx_shortCycle_timer;
uint16_t drx_shortCycle_timer_thres; uint16_t drx_shortCycle_timer_thres;
/// is TRUE if UE is currently in long DRX cycle /// is true if UE is currently in long DRX cycle
boolean_t in_long_drx_cycle; bool in_long_drx_cycle;
/// longDRX-CycleStartOffset (long DRX cycle timer) /// longDRX-CycleStartOffset (long DRX cycle timer)
uint16_t drx_longCycle_timer; uint16_t drx_longCycle_timer;
uint16_t drx_longCycle_timer_thres; uint16_t drx_longCycle_timer_thres;
...@@ -1183,7 +1183,7 @@ typedef struct { ...@@ -1183,7 +1183,7 @@ typedef struct {
UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_ENB]; UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_ENB];
UE_list_t list; UE_list_t list;
int num_UEs; int num_UEs;
boolean_t active[MAX_MOBILES_PER_ENB]; bool active[MAX_MOBILES_PER_ENB];
} UE_info_t; } UE_info_t;
/*! \brief deleting control information*/ /*! \brief deleting control information*/
...@@ -1191,9 +1191,9 @@ typedef struct { ...@@ -1191,9 +1191,9 @@ typedef struct {
///rnti of UE ///rnti of UE
rnti_t rnti; rnti_t rnti;
///remove UE context flag ///remove UE context flag
boolean_t removeContextFlg; bool removeContextFlg;
///remove RA flag ///remove RA flag
boolean_t raFlag; bool raFlag;
} UE_free_ctrl_t; } UE_free_ctrl_t;
/*! \brief REMOVE UE list used by eNB to order UEs/CC for deleting*/ /*! \brief REMOVE UE list used by eNB to order UEs/CC for deleting*/
typedef struct { typedef struct {
......
...@@ -71,7 +71,7 @@ extern rb_id_t mbms_rab_id; ...@@ -71,7 +71,7 @@ extern rb_id_t mbms_rab_id;
extern uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; extern uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX];
extern uint8_t dlsch_ue_select_tbl_in_use; extern uint8_t dlsch_ue_select_tbl_in_use;
extern uint8_t new_dlsch_ue_select_tbl_in_use; extern uint8_t new_dlsch_ue_select_tbl_in_use;
extern boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX]; extern bool pre_scd_activeUE[NUMBER_OF_UE_MAX];
extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
#endif #endif
......
...@@ -400,7 +400,7 @@ int find_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP); ...@@ -400,7 +400,7 @@ int find_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP);
rnti_t UE_RNTI(module_id_t module_idP, int UE_id); rnti_t UE_RNTI(module_id_t module_idP, int UE_id);
int UE_PCCID(module_id_t module_idP, int UE_id); int UE_PCCID(module_id_t module_idP, int UE_id);
uint8_t find_active_UEs(module_id_t module_idP); uint8_t find_active_UEs(module_id_t module_idP);
boolean_t is_UE_active(module_id_t module_idP, int UE_id); bool is_UE_active(module_id_t module_idP, int UE_id);
uint8_t get_aggregation(uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt); uint8_t get_aggregation(uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt);
int8_t find_active_UEs_with_traffic(module_id_t module_idP); int8_t find_active_UEs_with_traffic(module_id_t module_idP);
...@@ -416,11 +416,11 @@ int get_nCCE_offset(int *CCE_table, ...@@ -416,11 +416,11 @@ int get_nCCE_offset(int *CCE_table,
int allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, int test_only); int allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, int test_only);
boolean_t CCE_allocation_infeasible(int module_idP, bool CCE_allocation_infeasible(int module_idP,
int CC_idP, int CC_idP,
int common_flag, int common_flag,
int subframe, int subframe,
int aggregation, int rnti); int aggregation, int rnti);
/* tries to allocate a CCE. If it succeeds, reserves NFAPI DCI and DLSCH config */ /* tries to allocate a CCE. If it succeeds, reserves NFAPI DCI and DLSCH config */
int CCE_try_allocate_dlsch(int module_id, int CCE_try_allocate_dlsch(int module_id,
int CC_id, int CC_id,
...@@ -741,13 +741,12 @@ BSR_SHORT *get_bsr_short(module_id_t module_idP, uint8_t bsr_len); ...@@ -741,13 +741,12 @@ BSR_SHORT *get_bsr_short(module_id_t module_idP, uint8_t bsr_len);
*/ */
BSR_LONG *get_bsr_long(module_id_t module_idP, uint8_t bsr_len); BSR_LONG *get_bsr_long(module_id_t module_idP, uint8_t bsr_len);
/*! \fn boolean_t update_bsr(module_id_t module_idP, frame_t frameP,sub_frame_t subframeP) /*! \fn bool update_bsr(module_id_t module_idP, frame_t frameP,sub_frame_t subframeP)
\brief get the rlc stats and update the bsr level for each lcid \brief get the rlc stats and update the bsr level for each lcid
\param[in] Mod_id instance of the UE \param[in] Mod_id instance of the UE
\param[in] frame Frame index \param[in] frame Frame index
*/ */
boolean_t update_bsr(module_id_t module_idP, frame_t frameP, bool update_bsr(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, eNB_index_t eNB_index);
sub_frame_t subframeP, eNB_index_t eNB_index);
/*! \fn locate_BsrIndexByBufferSize (int *table, int size, int value) /*! \fn locate_BsrIndexByBufferSize (int *table, int size, int value)
\brief locate the BSR level in the table as defined in 36.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table. \brief locate the BSR level in the table as defined in 36.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table.
......
...@@ -638,7 +638,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -638,7 +638,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
LOG_E(MAC, "UE %d has RNTI NOT_A_RNTI!\n", UE_id); LOG_E(MAC, "UE %d has RNTI NOT_A_RNTI!\n", UE_id);
continue; continue;
} }
if (UE_info->active[UE_id] != TRUE) { if (UE_info->active[UE_id] != true) {
LOG_E(MAC, "UE %d RNTI %x is NOT active!\n", UE_id, rnti); LOG_E(MAC, "UE %d RNTI %x is NOT active!\n", UE_id, rnti);
continue; continue;
} }
......
...@@ -2325,8 +2325,8 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -2325,8 +2325,8 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
uint8_t bsr_len = 0, bsr_ce_len = 0, bsr_header_len = 0; uint8_t bsr_len = 0, bsr_ce_len = 0, bsr_header_len = 0;
uint8_t phr_header_len = 0, phr_ce_len = 0, phr_len = 0; uint8_t phr_header_len = 0, phr_ce_len = 0, phr_len = 0;
uint8_t lcid = 0, lcid_rlc_pdu_count = 0; uint8_t lcid = 0, lcid_rlc_pdu_count = 0;
boolean_t is_lcid_processed = FALSE; bool is_lcid_processed = false;
boolean_t is_all_lcid_processed = FALSE; bool is_all_lcid_processed = false;
uint16_t sdu_lengths[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; uint16_t sdu_lengths[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t sdu_lcids[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; uint8_t sdu_lcids[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t payload_offset = 0, num_sdus = 0; uint8_t payload_offset = 0, num_sdus = 0;
...@@ -2444,11 +2444,11 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -2444,11 +2444,11 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
// Check for DCCH first // Check for DCCH first
// TO DO: Multiplex in the order defined by the logical channel prioritization // TO DO: Multiplex in the order defined by the logical channel prioritization
for (lcid = DCCH; for (lcid = DCCH;
(lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE); lcid++) { (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == false); lcid++) {
if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] ==
LCID_NOT_EMPTY) { LCID_NOT_EMPTY) {
lcid_rlc_pdu_count = 0; lcid_rlc_pdu_count = 0;
is_lcid_processed = FALSE; is_lcid_processed = false;
lcid_buffer_occupancy_old = lcid_buffer_occupancy_old =
mac_rlc_get_buffer_occupancy_ind(module_idP, mac_rlc_get_buffer_occupancy_ind(module_idP,
UE_mac_inst[module_idP]. UE_mac_inst[module_idP].
...@@ -2536,8 +2536,8 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -2536,8 +2536,8 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
//No more remaining TBS after this PDU //No more remaining TBS after this PDU
//exit the function //exit the function
rlc_pdu_header_len_last = 1; rlc_pdu_header_len_last = 1;
is_lcid_processed = TRUE; is_lcid_processed = true;
is_all_lcid_processed = TRUE; is_all_lcid_processed = true;
} else { } else {
rlc_pdu_header_len_last = rlc_pdu_header_len_last =
(sdu_lengths[num_sdus] > 128) ? 3 : 2; (sdu_lengths[num_sdus] > 128) ? 3 : 2;
...@@ -2547,8 +2547,8 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -2547,8 +2547,8 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
(bsr_len + phr_len + total_rlc_pdu_header_len + (bsr_len + phr_len + total_rlc_pdu_header_len +
rlc_pdu_header_len_last + sdu_length_total)) { rlc_pdu_header_len_last + sdu_length_total)) {
rlc_pdu_header_len_last = 1; rlc_pdu_header_len_last = 1;
is_lcid_processed = TRUE; is_lcid_processed = true;
is_all_lcid_processed = TRUE; is_all_lcid_processed = true;
} }
} }
...@@ -2559,7 +2559,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -2559,7 +2559,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
lcid_rlc_pdu_count++; lcid_rlc_pdu_count++;
} else { } else {
/* avoid infinite loop ... */ /* avoid infinite loop ... */
is_lcid_processed = TRUE; is_lcid_processed = true;
} }
/* Get updated BO after multiplexing this PDU */ /* Get updated BO after multiplexing this PDU */
...@@ -3164,7 +3164,7 @@ ue_scheduler(const module_id_t module_idP, ...@@ -3164,7 +3164,7 @@ ue_scheduler(const module_id_t module_idP,
} }
//Check whether Regular BSR is triggered //Check whether Regular BSR is triggered
if (update_bsr(module_idP, txFrameP, txSubframeP, eNB_indexP) == TRUE) { if (update_bsr(module_idP, txFrameP, txSubframeP, eNB_indexP) == true) {
// call SR procedure to generate pending SR and BSR for next PUCCH/PUSCH TxOp. This should implement the procedures // call SR procedure to generate pending SR and BSR for next PUCCH/PUSCH TxOp. This should implement the procedures
// outlined in Sections 5.4.4 an 5.4.5 of 36.321 // outlined in Sections 5.4.4 an 5.4.5 of 36.321
UE_mac_inst[module_idP].scheduling_info.SR_pending = 1; UE_mac_inst[module_idP].scheduling_info.SR_pending = 1;
...@@ -3251,11 +3251,11 @@ ue_scheduler(const module_id_t module_idP, ...@@ -3251,11 +3251,11 @@ ue_scheduler(const module_id_t module_idP,
// to be improved // to be improved
boolean_t bool
update_bsr(module_id_t module_idP, frame_t frameP, update_bsr(module_id_t module_idP, frame_t frameP,
sub_frame_t subframeP, eNB_index_t eNB_index) { sub_frame_t subframeP, eNB_index_t eNB_index) {
mac_rlc_status_resp_t rlc_status; mac_rlc_status_resp_t rlc_status;
boolean_t bsr_regular_triggered = FALSE; bool bsr_regular_triggered = false;
uint8_t lcid; uint8_t lcid;
uint8_t lcgid; uint8_t lcgid;
uint8_t num_lcid_with_data = 0; // for LCID with data only if LCGID is defined uint8_t num_lcid_with_data = 0; // for LCID with data only if LCGID is defined
...@@ -3352,7 +3352,7 @@ update_bsr(module_id_t module_idP, frame_t frameP, ...@@ -3352,7 +3352,7 @@ update_bsr(module_id_t module_idP, frame_t frameP,
(lcgid_buffer_remain (lcgid_buffer_remain
[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] == [UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] ==
0)) { 0)) {
bsr_regular_triggered = TRUE; bsr_regular_triggered = true;
LOG_D(MAC, LOG_D(MAC,
"[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d subframe %d\n", "[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d subframe %d\n",
module_idP, lcid, module_idP, lcid,
...@@ -3364,7 +3364,7 @@ update_bsr(module_id_t module_idP, frame_t frameP, ...@@ -3364,7 +3364,7 @@ update_bsr(module_id_t module_idP, frame_t frameP,
// Trigger Regular BSR if ReTxBSR Timer has expired and UE has data for transmission // Trigger Regular BSR if ReTxBSR Timer has expired and UE has data for transmission
if (UE_mac_inst[module_idP].scheduling_info.retxBSR_SF == 0) { if (UE_mac_inst[module_idP].scheduling_info.retxBSR_SF == 0) {
bsr_regular_triggered = TRUE; bsr_regular_triggered = true;
if ((UE_mac_inst[module_idP].BSR_reporting_active & if ((UE_mac_inst[module_idP].BSR_reporting_active &
BSR_TRIGGER_REGULAR) == 0) { BSR_TRIGGER_REGULAR) == 0) {
......
...@@ -74,7 +74,7 @@ extern uint8_t rb_table[34]; ...@@ -74,7 +74,7 @@ extern uint8_t rb_table[34];
extern uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; extern uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX];
extern uint8_t dlsch_ue_select_tbl_in_use; extern uint8_t dlsch_ue_select_tbl_in_use;
extern uint8_t new_dlsch_ue_select_tbl_in_use; extern uint8_t new_dlsch_ue_select_tbl_in_use;
extern boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX]; extern bool pre_scd_activeUE[NUMBER_OF_UE_MAX];
extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
#endif*/ #endif*/
......
...@@ -580,7 +580,7 @@ int nr_rrc_mac_config_req_ue_logicalChannelBearer( ...@@ -580,7 +580,7 @@ int nr_rrc_mac_config_req_ue_logicalChannelBearer(
int cc_idP, int cc_idP,
uint8_t gNB_index, uint8_t gNB_index,
long logicalChannelIdentity, long logicalChannelIdentity,
boolean_t status){ bool status){
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
mac->logicalChannelBearer_exist[logicalChannelIdentity] = status; mac->logicalChannelBearer_exist[logicalChannelIdentity] = status;
return 0; return 0;
......
...@@ -415,7 +415,7 @@ typedef struct { ...@@ -415,7 +415,7 @@ typedef struct {
uint8_t BSR_reporting_active; uint8_t BSR_reporting_active;
/// LogicalChannelConfig has bearer. /// LogicalChannelConfig has bearer.
boolean_t logicalChannelBearer_exist[NR_MAX_NUM_LCID]; bool logicalChannelBearer_exist[NR_MAX_NUM_LCID];
NR_UE_SCHEDULING_INFO scheduling_info; NR_UE_SCHEDULING_INFO scheduling_info;
/// PHR /// PHR
...@@ -546,7 +546,7 @@ typedef struct prach_association_pattern { ...@@ -546,7 +546,7 @@ typedef struct prach_association_pattern {
// SSB details // SSB details
typedef struct ssb_info { typedef struct ssb_info {
boolean_t transmitted; // True if the SSB index is transmitted according to the SSB positions map configuration bool transmitted; // True if the SSB index is transmitted according to the SSB positions map configuration
prach_occasion_info_t *mapped_ro[MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN]; // List of mapped RACH Occasions to this SSB index prach_occasion_info_t *mapped_ro[MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN]; // List of mapped RACH Occasions to this SSB index
uint16_t nb_mapped_ro; // Total number of mapped ROs to this SSB index uint16_t nb_mapped_ro; // Total number of mapped ROs to this SSB index
} ssb_info_t; } ssb_info_t;
......
...@@ -85,14 +85,12 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id, ...@@ -85,14 +85,12 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
\param cc_id component carrier id \param cc_id component carrier id
\param gNB_index gNB index \param gNB_index gNB index
\param long logicalChannelIdentity \param long logicalChannelIdentity
\param boolean_t status*/ \param bool status*/
int nr_rrc_mac_config_req_ue_logicalChannelBearer( int nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
module_id_t module_id, int cc_idP,
int cc_idP, uint8_t gNB_index,
uint8_t gNB_index, long logicalChannelIdentity,
long logicalChannelIdentity, bool status);
boolean_t status
);
/**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config) /**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config)
\param module_id module id \param module_id module id
...@@ -154,14 +152,14 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response, ...@@ -154,14 +152,14 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response,
*/ */
int8_t nr_ue_get_SR(module_id_t module_idP, frame_t frameP, slot_t slotP); int8_t nr_ue_get_SR(module_id_t module_idP, frame_t frameP, slot_t slotP);
/*! \fn boolean_t update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index) /*! \fn bool update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index)
\brief get the rlc stats and update the bsr level for each lcid \brief get the rlc stats and update the bsr level for each lcid
\param[in] Mod_id instance of the UE \param[in] Mod_id instance of the UE
\param[in] frameP Frame index \param[in] frameP Frame index
\param[in] slot slotP number \param[in] slot slotP number
\param[in] uint8_t gNB_index \param[in] uint8_t gNB_index
*/ */
boolean_t nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index); bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index);
/*! \fn nr_locate_BsrIndexByBufferSize (int *table, int size, int value) /*! \fn nr_locate_BsrIndexByBufferSize (int *table, int size, int value)
\brief locate the BSR level in the table as defined in 38.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table. \brief locate the BSR level in the table as defined in 38.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table.
......
...@@ -325,7 +325,7 @@ void ssb_rach_config(RA_config_t *ra, NR_PRACH_RESOURCES_t *prach_resources, NR_ ...@@ -325,7 +325,7 @@ void ssb_rach_config(RA_config_t *ra, NR_PRACH_RESOURCES_t *prach_resources, NR_
// ======================================= // =======================================
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present; NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
boolean_t multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB bool multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB
uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB
int total_preambles_per_ssb; int total_preambles_per_ssb;
uint8_t ssb_nb_in_ro; uint8_t ssb_nb_in_ro;
......
...@@ -2002,7 +2002,7 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size) { ...@@ -2002,7 +2002,7 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size) {
* processing slots of reception/transmission * processing slots of reception/transmission
* gNB_id identifier * gNB_id identifier
* *
* RETURN : TRUE a valid resource has been found * RETURN : true a valid resource has been found
* *
* DESCRIPTION : return tx harq process identifier for given transmission slot * DESCRIPTION : return tx harq process identifier for given transmission slot
* TS 38.213 9.2.1 PUCCH Resource Sets * TS 38.213 9.2.1 PUCCH Resource Sets
...@@ -2132,7 +2132,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, ...@@ -2132,7 +2132,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
int number_harq_feedback = 0; int number_harq_feedback = 0;
uint32_t dai_current = 0; uint32_t dai_current = 0;
uint32_t dai_max = 0; uint32_t dai_max = 0;
bool two_transport_blocks = FALSE; bool two_transport_blocks = false;
int number_of_code_word = 1; int number_of_code_word = 1;
int U_DAI_c = 0; int U_DAI_c = 0;
int N_m_c_rx = 0; int N_m_c_rx = 0;
...@@ -2154,7 +2154,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, ...@@ -2154,7 +2154,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
bwpd->pdsch_Config->choice.setup && bwpd->pdsch_Config->choice.setup &&
bwpd->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI && bwpd->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI &&
bwpd->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0] == 2) { bwpd->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0] == 2) {
two_transport_blocks = TRUE; two_transport_blocks = true;
number_of_code_word = 2; number_of_code_word = 2;
} }
...@@ -2254,7 +2254,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, ...@@ -2254,7 +2254,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
* For a monitoring occasion of a PDCCH with DCI format 1_0 or DCI format 1_1 in at least one serving cell, * For a monitoring occasion of a PDCCH with DCI format 1_0 or DCI format 1_1 in at least one serving cell,
* when a UE receives a PDSCH with one transport block and the value of higher layer parameter maxNrofCodeWordsScheduledByDCI is 2, * when a UE receives a PDSCH with one transport block and the value of higher layer parameter maxNrofCodeWordsScheduledByDCI is 2,
* the HARQ-ACK response is associated with the first transport block and the UE generates a NACK for the second transport block * the HARQ-ACK response is associated with the first transport block and the UE generates a NACK for the second transport block
* if spatial bundling is not applied (HARQ-ACK-spatial-bundling-PUCCH = FALSE) and generates HARQ-ACK value of ACK for the second * if spatial bundling is not applied (HARQ-ACK-spatial-bundling-PUCCH = false) and generates HARQ-ACK value of ACK for the second
* transport block if spatial bundling is applied. * transport block if spatial bundling is applied.
*/ */
...@@ -2265,7 +2265,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, ...@@ -2265,7 +2265,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
ack_data[code_word][i] = 0; /* nack data transport block which has been missed */ ack_data[code_word][i] = 0; /* nack data transport block which has been missed */
number_harq_feedback++; number_harq_feedback++;
} }
if (two_transport_blocks == TRUE) { if (two_transport_blocks == true) {
dai_total[code_word][i] = dai[code_word][i]; /* for a single cell, dai_total is the same as dai of first cell */ dai_total[code_word][i] = dai[code_word][i]; /* for a single cell, dai_total is the same as dai of first cell */
} }
} }
...@@ -2296,7 +2296,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, ...@@ -2296,7 +2296,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
o_ACK = o_ACK | (ack_data[1][m] << O_bit_number_cw1); o_ACK = o_ACK | (ack_data[1][m] << O_bit_number_cw1);
} }
if (two_transport_blocks == TRUE) { if (two_transport_blocks == true) {
O_bit_number_cw0 = (8 * j) + 2*(V_temp - 1); O_bit_number_cw0 = (8 * j) + 2*(V_temp - 1);
} }
else { else {
...@@ -2311,7 +2311,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, ...@@ -2311,7 +2311,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
j = j + 1; j = j + 1;
} }
if (two_transport_blocks == TRUE) { if (two_transport_blocks == true) {
O_ACK = 2 * ( 4 * j + V_temp2); /* for two transport blocks */ O_ACK = 2 * ( 4 * j + V_temp2); /* for two transport blocks */
} }
else { else {
......
...@@ -1254,7 +1254,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in ...@@ -1254,7 +1254,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
} }
//Check whether Regular BSR is triggered //Check whether Regular BSR is triggered
if (nr_update_bsr(mod_id, txFrameP, txSlotP, gNB_indexP) == TRUE) { if (nr_update_bsr(mod_id, txFrameP, txSlotP, gNB_indexP) == true) {
// call SR procedure to generate pending SR and BSR for next PUCCH/PUSCH TxOp. This should implement the procedures // call SR procedure to generate pending SR and BSR for next PUCCH/PUSCH TxOp. This should implement the procedures
// outlined in Sections 5.4.4 an 5.4.5 of 38.321 // outlined in Sections 5.4.4 an 5.4.5 of 38.321
mac->scheduling_info.SR_pending = 1; mac->scheduling_info.SR_pending = 1;
...@@ -1267,10 +1267,10 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in ...@@ -1267,10 +1267,10 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
} }
boolean_t bool
nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index) { nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index) {
mac_rlc_status_resp_t rlc_status; mac_rlc_status_resp_t rlc_status;
boolean_t bsr_regular_triggered = FALSE; bool bsr_regular_triggered = false;
uint8_t lcid; uint8_t lcid;
uint8_t lcgid; uint8_t lcgid;
uint8_t num_lcid_with_data = 0; // for LCID with data only if LCGID is defined uint8_t num_lcid_with_data = 0; // for LCID with data only if LCGID is defined
...@@ -1363,7 +1363,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_ ...@@ -1363,7 +1363,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_
which belong to any LCG and for which data is already available for transmission which belong to any LCG and for which data is already available for transmission
*/ */
{ {
bsr_regular_triggered = TRUE; bsr_regular_triggered = true;
LOG_D(NR_MAC, "[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d slot %d\n", LOG_D(NR_MAC, "[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d slot %d\n",
module_idP, lcid, module_idP, lcid,
mac->scheduling_info.LCGID[lcid], mac->scheduling_info.LCGID[lcid],
...@@ -1374,7 +1374,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_ ...@@ -1374,7 +1374,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_
// Trigger Regular BSR if ReTxBSR Timer has expired and UE has data for transmission // Trigger Regular BSR if ReTxBSR Timer has expired and UE has data for transmission
if (mac->scheduling_info.retxBSR_SF == 0) { if (mac->scheduling_info.retxBSR_SF == 0) {
bsr_regular_triggered = TRUE; bsr_regular_triggered = true;
if ((mac->BSR_reporting_active & NR_BSR_TRIGGER_REGULAR) == 0) { if ((mac->BSR_reporting_active & NR_BSR_TRIGGER_REGULAR) == 0) {
LOG_I(NR_MAC, "[UE %d] PDCCH Tick : MAC BSR Triggered ReTxBSR Timer expiry at frame %d slot %d\n", LOG_I(NR_MAC, "[UE %d] PDCCH Tick : MAC BSR Triggered ReTxBSR Timer expiry at frame %d slot %d\n",
...@@ -1635,7 +1635,7 @@ static void build_ro_list(NR_UE_MAC_INST_t *mac) { ...@@ -1635,7 +1635,7 @@ static void build_ro_list(NR_UE_MAC_INST_t *mac) {
int y2; // PRACH Configuration Index table additional variable used to compute the valid frame numbers int y2; // PRACH Configuration Index table additional variable used to compute the valid frame numbers
uint8_t slot_shift_for_map; uint8_t slot_shift_for_map;
uint8_t map_shift; uint8_t map_shift;
boolean_t even_slot_invalid; bool even_slot_invalid;
int64_t s_map; int64_t s_map;
uint8_t prach_conf_start_symbol; // Starting symbol of the PRACH occasions in the PRACH slot uint8_t prach_conf_start_symbol; // Starting symbol of the PRACH occasions in the PRACH slot
uint8_t N_t_slot; // Number of PRACH occasions in a 14-symbols PRACH slot uint8_t N_t_slot; // Number of PRACH occasions in a 14-symbols PRACH slot
...@@ -1907,7 +1907,7 @@ static void map_ssb_to_ro(NR_UE_MAC_INST_t *mac) { ...@@ -1907,7 +1907,7 @@ static void map_ssb_to_ro(NR_UE_MAC_INST_t *mac) {
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup; mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup;
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present; NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
boolean_t multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB bool multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB
uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB
uint16_t required_nb_of_prach_occasion; // Nb of RACH occasions required to map all the SSBs uint16_t required_nb_of_prach_occasion; // Nb of RACH occasions required to map all the SSBs
uint8_t required_nb_of_prach_conf_period; // Nb of PRACH configuration periods required to map all the SSBs uint8_t required_nb_of_prach_conf_period; // Nb of PRACH configuration periods required to map all the SSBs
......
...@@ -365,6 +365,18 @@ void nr_store_dlsch_buffer(module_id_t module_id, ...@@ -365,6 +365,18 @@ void nr_store_dlsch_buffer(module_id_t module_id,
} }
} }
void abort_nr_dl_harq(NR_UE_info_t* UE, int8_t harq_pid) {
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
NR_UE_harq_t *harq = &sched_ctrl->harq_processes[harq_pid];
harq->ndi ^= 1;
harq->round = 0;
UE->mac_stats.dl.errors++;
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq_pid);
}
bool allocate_dl_retransmission(module_id_t module_id, bool allocate_dl_retransmission(module_id_t module_id,
frame_t frame, frame_t frame,
sub_frame_t slot, sub_frame_t slot,
...@@ -378,6 +390,17 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -378,6 +390,17 @@ bool allocate_dl_retransmission(module_id_t module_id,
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch; NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch;
NR_CellGroupConfig_t *cg = UE->CellGroup; NR_CellGroupConfig_t *cg = UE->CellGroup;
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
//TODO remove this and handle retransmission with old nrOfLayers
// once ps structure is removed
if(ps->nrOfLayers < retInfo->nrOfLayers) {
LOG_W(NR_MAC,"Cannot schedule retransmission. RI changed from %d to %d\n",
retInfo->nrOfLayers, ps->nrOfLayers);
abort_nr_dl_harq(UE, current_harq_pid);
remove_front_nr_list(&sched_ctrl->retrans_dl_harq);
return false;
}
NR_BWP_DownlinkDedicated_t *bwpd = NR_BWP_DownlinkDedicated_t *bwpd =
cg && cg &&
...@@ -401,7 +424,6 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -401,7 +424,6 @@ bool allocate_dl_retransmission(module_id_t module_id,
const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
int rbStart = 0; // start wrt BWPstart int rbStart = 0; // start wrt BWPstart
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
int rbSize = 0; int rbSize = 0;
const int tda = get_dl_tda(RC.nrmac[module_id], scc, slot); const int tda = get_dl_tda(RC.nrmac[module_id], scc, slot);
AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n"); AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n");
...@@ -1355,6 +1377,8 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1355,6 +1377,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
/* save which time allocation has been used, to be used on /* save which time allocation has been used, to be used on
* retransmissions */ * retransmissions */
harq->sched_pdsch.time_domain_allocation = ps->time_domain_allocation; harq->sched_pdsch.time_domain_allocation = ps->time_domain_allocation;
/* save nr of layers for retransmissions */
harq->sched_pdsch.nrOfLayers = ps->nrOfLayers;
// ta command is sent, values are reset // ta command is sent, values are reset
if (sched_ctrl->ta_apply) { if (sched_ctrl->ta_apply) {
......
...@@ -826,14 +826,8 @@ static void handle_dl_harq(NR_UE_info_t * UE, ...@@ -826,14 +826,8 @@ static void handle_dl_harq(NR_UE_info_t * UE,
harq->ndi ^= 1; harq->ndi ^= 1;
} else if (harq->round >= harq_round_max - 1) { } else if (harq->round >= harq_round_max - 1) {
add_tail_nr_list(&UE->UE_sched_ctrl.available_dl_harq, harq_pid); abort_nr_dl_harq(UE, harq_pid);
harq->round = 0; LOG_D(NR_MAC, "retransmission error for UE %04x (total %"PRIu64")\n", UE->rnti, UE->mac_stats.dl.errors);
harq->ndi ^= 1;
NR_mac_stats_t *stats = &UE->mac_stats;
stats->dl.errors++;
LOG_D(NR_MAC, "retransmission error for UE %04x (total %"PRIu64")\n", UE->rnti, stats->dl.errors);
} else { } else {
LOG_D(PHY,"NACK for: pid %d, ue %04x\n",harq_pid, UE->rnti); LOG_D(PHY,"NACK for: pid %d, ue %04x\n",harq_pid, UE->rnti);
add_tail_nr_list(&UE->UE_sched_ctrl.retrans_dl_harq, harq_pid); add_tail_nr_list(&UE->UE_sched_ctrl.retrans_dl_harq, harq_pid);
......
...@@ -529,4 +529,6 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset ...@@ -529,4 +529,6 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl); void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl);
void abort_nr_dl_harq(NR_UE_info_t* UE, int8_t harq_pid);
#endif /*__LAYER2_NR_MAC_PROTO_H__*/ #endif /*__LAYER2_NR_MAC_PROTO_H__*/
...@@ -215,8 +215,8 @@ void mac_top_init_gNB(void) ...@@ -215,8 +215,8 @@ void mac_top_init_gNB(void)
RC.nrmac[i]->pre_processor_dl = nr_init_fr1_dlsch_preprocessor(i, 0); RC.nrmac[i]->pre_processor_dl = nr_init_fr1_dlsch_preprocessor(i, 0);
RC.nrmac[i]->pre_processor_ul = nr_init_fr1_ulsch_preprocessor(i, 0); RC.nrmac[i]->pre_processor_ul = nr_init_fr1_ulsch_preprocessor(i, 0);
} }
pthread_create(&RC.nrmac[i]->stats_thread,NULL,nrmac_stats_thread,(void*)RC.nrmac[i]); if (!IS_SOFTMODEM_NOSTATS_BIT)
pthread_create(&RC.nrmac[i]->stats_thread, NULL, nrmac_stats_thread, (void*)RC.nrmac[i]);
}//END for (i = 0; i < RC.nb_nr_macrlc_inst; i++) }//END for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
AssertFatal(rlc_module_init(1) == 0,"Could not initialize RLC layer\n"); AssertFatal(rlc_module_init(1) == 0,"Could not initialize RLC layer\n");
......
...@@ -441,6 +441,7 @@ typedef struct NR_sched_pdsch { ...@@ -441,6 +441,7 @@ typedef struct NR_sched_pdsch {
/// only important for retransmissions; otherwise, the TDA in /// only important for retransmissions; otherwise, the TDA in
/// NR_pdsch_semi_static_t has precedence /// NR_pdsch_semi_static_t has precedence
int time_domain_allocation; int time_domain_allocation;
uint8_t nrOfLayers;
} NR_sched_pdsch_t; } NR_sched_pdsch_t;
typedef struct NR_UE_harq { typedef struct NR_UE_harq {
...@@ -674,7 +675,6 @@ typedef struct { ...@@ -674,7 +675,6 @@ typedef struct {
} NR_UE_sched_ctrl_t; } NR_UE_sched_ctrl_t;
typedef struct { typedef struct {
boolean_t fiveG_connected;
uicc_t *uicc; uicc_t *uicc;
} NRUEcontext_t; } NRUEcontext_t;
......
This diff is collapsed.
...@@ -51,7 +51,7 @@ typedef rlc_op_status_t (*send_rlc_data_req_func_t)(const protocol_ctxt_t *cons ...@@ -51,7 +51,7 @@ typedef rlc_op_status_t (*send_rlc_data_req_func_t)(const protocol_ctxt_t *cons
const rb_id_t, const mui_t, const rb_id_t, const mui_t,
confirm_t, sdu_size_t, mem_block_t *,const uint32_t *const, const uint32_t *const); confirm_t, sdu_size_t, mem_block_t *,const uint32_t *const, const uint32_t *const);
typedef boolean_t (pdcp_data_ind_t)( const protocol_ctxt_t *, const srb_flag_t, typedef bool (pdcp_data_ind_t)( const protocol_ctxt_t *, const srb_flag_t,
const MBMS_flag_t, const rb_id_t, const sdu_size_t, const MBMS_flag_t, const rb_id_t, const sdu_size_t,
mem_block_t *,const uint32_t *const, const uint32_t *const); mem_block_t *,const uint32_t *const, const uint32_t *const);
typedef pdcp_data_ind_t* pdcp_data_ind_func_t; typedef pdcp_data_ind_t* pdcp_data_ind_func_t;
...@@ -153,14 +153,13 @@ typedef struct pdcp_stats_s { ...@@ -153,14 +153,13 @@ typedef struct pdcp_stats_s {
typedef struct pdcp_s { typedef struct pdcp_s {
//boolean_t instanciated_instance;
uint16_t header_compression_profile; uint16_t header_compression_profile;
/* SR: added this flag to distinguish UE/eNB instance as pdcp_run for virtual /* SR: added this flag to distinguish UE/eNB instance as pdcp_run for virtual
* mode can receive data on NETLINK for eNB while eNB_flag = 0 and for UE when eNB_flag = 1 * mode can receive data on NETLINK for eNB while eNB_flag = 0 and for UE when eNB_flag = 1
*/ */
boolean_t is_ue; bool is_ue;
boolean_t is_srb; bool is_srb;
/* Configured security algorithms */ /* Configured security algorithms */
uint8_t cipheringAlgorithm; uint8_t cipheringAlgorithm;
...@@ -217,7 +216,7 @@ typedef struct pdcp_s { ...@@ -217,7 +216,7 @@ typedef struct pdcp_s {
} pdcp_t; } pdcp_t;
typedef struct pdcp_mbms_s { typedef struct pdcp_mbms_s {
boolean_t instanciated_instance; bool instanciated_instance;
rb_id_t rb_id; rb_id_t rb_id;
} pdcp_mbms_t; } pdcp_mbms_t;
...@@ -230,7 +229,7 @@ typedef struct pdcp_mbms_s { ...@@ -230,7 +229,7 @@ typedef struct pdcp_mbms_s {
* under targets/TEST/PDCP/ * under targets/TEST/PDCP/
*/ */
/*! \fn boolean_t pdcp_data_req(const protocol_ctxt_t* const , srb_flag_t , rb_id_t , mui_t , confirm_t ,sdu_size_t , unsigned char* , pdcp_transmission_mode_t ) /*! \fn bool pdcp_data_req(const protocol_ctxt_t* const , srb_flag_t , rb_id_t , mui_t , confirm_t ,sdu_size_t , unsigned char* , pdcp_transmission_mode_t )
* \brief This functions handles data transfer requests coming either from RRC or from IP * \brief This functions handles data transfer requests coming either from RRC or from IP
* \param[in] ctxt_pP Running context. * \param[in] ctxt_pP Running context.
* \param[in] rab_id Radio Bearer ID * \param[in] rab_id Radio Bearer ID
...@@ -239,38 +238,34 @@ typedef struct pdcp_mbms_s { ...@@ -239,38 +238,34 @@ typedef struct pdcp_mbms_s {
* \param[in] sdu_buffer_size Size of incoming SDU in bytes * \param[in] sdu_buffer_size Size of incoming SDU in bytes
* \param[in] sdu_buffer Buffer carrying SDU * \param[in] sdu_buffer Buffer carrying SDU
* \param[in] mode flag to indicate whether the userplane data belong to the control plane or data plane or transparent * \param[in] mode flag to indicate whether the userplane data belong to the control plane or data plane or transparent
* \return TRUE on success, FALSE otherwise * \return true on success, false otherwise
* \note None * \note None
* @ingroup _pdcp * @ingroup _pdcp
*/ */
boolean_t pdcp_data_req( bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
protocol_ctxt_t *ctxt_pP, const srb_flag_t srb_flagP,
const srb_flag_t srb_flagP, const rb_id_t rb_id,
const rb_id_t rb_id, const mui_t muiP,
const mui_t muiP, const confirm_t confirmP,
const confirm_t confirmP, const sdu_size_t sdu_buffer_size,
const sdu_size_t sdu_buffer_size, unsigned char *const sdu_buffer,
unsigned char *const sdu_buffer, const pdcp_transmission_mode_t mode,
const pdcp_transmission_mode_t mode, const uint32_t * sourceL2Id,
const uint32_t * sourceL2Id, const uint32_t * destinationL2Id);
const uint32_t * destinationL2Id
); bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
const srb_flag_t srb_flagP,
boolean_t cu_f1u_data_req( const rb_id_t rb_id,
protocol_ctxt_t *ctxt_pP, const mui_t muiP,
const srb_flag_t srb_flagP, const confirm_t confirmP,
const rb_id_t rb_id, const sdu_size_t sdu_buffer_size,
const mui_t muiP, unsigned char *const sdu_buffer,
const confirm_t confirmP, const pdcp_transmission_mode_t mode,
const sdu_size_t sdu_buffer_size, const uint32_t *const sourceL2Id,
unsigned char *const sdu_buffer, const uint32_t *const destinationL2Id);
const pdcp_transmission_mode_t mode,
const uint32_t *const sourceL2Id, /*! \fn bool pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, bool)
const uint32_t *const destinationL2Id
);
/*! \fn boolean_t pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, boolean_t)
* \brief This functions handles data transfer indications coming from RLC * \brief This functions handles data transfer indications coming from RLC
* \param[in] ctxt_pP Running context. * \param[in] ctxt_pP Running context.
* \param[in] Shows if rb is SRB * \param[in] Shows if rb is SRB
...@@ -279,7 +274,7 @@ boolean_t cu_f1u_data_req( ...@@ -279,7 +274,7 @@ boolean_t cu_f1u_data_req(
* \param[in] sdu_buffer_size Size of incoming SDU in bytes * \param[in] sdu_buffer_size Size of incoming SDU in bytes
* \param[in] sdu_buffer Buffer carrying SDU * \param[in] sdu_buffer Buffer carrying SDU
* \param[in] is_data_plane flag to indicate whether the userplane data belong to the control plane or data plane * \param[in] is_data_plane flag to indicate whether the userplane data belong to the control plane or data plane
* \return TRUE on success, FALSE otherwise * \return TRUE on success, false otherwise
* \note None * \note None
* @ingroup _pdcp * @ingroup _pdcp
*/ */
...@@ -316,20 +311,18 @@ void rrc_pdcp_config_req ( ...@@ -316,20 +311,18 @@ void rrc_pdcp_config_req (
* \param[in] defaultDRB Default DRB ID * \param[in] defaultDRB Default DRB ID
* \return A status about the processing, OK or error code. * \return A status about the processing, OK or error code.
*/ */
boolean_t rrc_pdcp_config_asn1_req ( bool rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
const protocol_ctxt_t *const ctxt_pP, LTE_SRB_ToAddModList_t *const srb2add_list,
LTE_SRB_ToAddModList_t *const srb2add_list, LTE_DRB_ToAddModList_t *const drb2add_list,
LTE_DRB_ToAddModList_t *const drb2add_list, LTE_DRB_ToReleaseList_t *const drb2release_list,
LTE_DRB_ToReleaseList_t *const drb2release_list, const uint8_t security_modeP,
const uint8_t security_modeP, uint8_t *const kRRCenc,
uint8_t *const kRRCenc, uint8_t *const kRRCint,
uint8_t *const kRRCint, uint8_t *const kUPenc,
uint8_t *const kUPenc, LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9,
LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9, rb_id_t *const defaultDRB);
rb_id_t *const defaultDRB
); /*! \fn bool pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode)
/*! \fn boolean_t pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode)
* \brief Function for RRC to configure a Radio Bearer. * \brief Function for RRC to configure a Radio Bearer.
* \param[in] ctxt_pP Running context. * \param[in] ctxt_pP Running context.
* \param[in] pdcp_pP Pointer on PDCP structure. * \param[in] pdcp_pP Pointer on PDCP structure.
...@@ -349,22 +342,21 @@ boolean_t rrc_pdcp_config_asn1_req ( ...@@ -349,22 +342,21 @@ boolean_t rrc_pdcp_config_asn1_req (
* \param[in] kUPenc User-Plane encryption key * \param[in] kUPenc User-Plane encryption key
* \return A status about the processing, OK or error code. * \return A status about the processing, OK or error code.
*/ */
boolean_t pdcp_config_req_asn1 ( bool pdcp_config_req_asn1(const protocol_ctxt_t *const ctxt_pP,
const protocol_ctxt_t *const ctxt_pP, pdcp_t *const pdcp_pP,
pdcp_t *const pdcp_pP, const srb_flag_t srb_flagP,
const srb_flag_t srb_flagP, const rlc_mode_t rlc_mode,
const rlc_mode_t rlc_mode, const uint32_t action,
const uint32_t action, const uint16_t lc_id,
const uint16_t lc_id, const uint16_t mch_id,
const uint16_t mch_id, const rb_id_t rb_id,
const rb_id_t rb_id, const uint8_t rb_sn,
const uint8_t rb_sn, const uint8_t rb_report,
const uint8_t rb_report, const uint16_t header_compression_profile,
const uint16_t header_compression_profile, const uint8_t security_mode,
const uint8_t security_mode, uint8_t *const kRRCenc,
uint8_t *const kRRCenc, uint8_t *const kRRCint,
uint8_t *const kRRCint, uint8_t *const kUPenc);
uint8_t *const kUPenc);
/*! \fn void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP) /*! \fn void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP)
* \brief Function (for RRC) to add a new UE in PDCP module * \brief Function (for RRC) to add a new UE in PDCP module
...@@ -373,13 +365,12 @@ boolean_t pdcp_config_req_asn1 ( ...@@ -373,13 +365,12 @@ boolean_t pdcp_config_req_asn1 (
*/ */
void pdcp_add_UE(const protocol_ctxt_t *const ctxt_pP); void pdcp_add_UE(const protocol_ctxt_t *const ctxt_pP);
/*! \fn boolean_t pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP) /*! \fn bool pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP)
* \brief Function for RRC to remove UE from PDCP module hashtable * \brief Function for RRC to remove UE from PDCP module hashtable
* \param[in] ctxt_pP Running context. * \param[in] ctxt_pP Running context.
* \return A status about the processing, OK or error code. * \return A status about the processing, OK or error code.
*/ */
boolean_t pdcp_remove_UE( bool pdcp_remove_UE(const protocol_ctxt_t *const ctxt_pP);
const protocol_ctxt_t *const ctxt_pP);
/*! \fn void rrc_pdcp_config_release( const protocol_ctxt_t* const, rb_id_t) /*! \fn void rrc_pdcp_config_release( const protocol_ctxt_t* const, rb_id_t)
* \brief This functions is unused * \brief This functions is unused
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "pdcp.h" #include "pdcp.h"
#include "pdcp_primitives.h" #include "pdcp_primitives.h"
extern boolean_t util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index); extern bool util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index);
/* /*
* Parses data/control field out of buffer of User Plane PDCP Data PDU with * Parses data/control field out of buffer of User Plane PDCP Data PDU with
...@@ -123,13 +123,13 @@ uint8_t pdcp_get_sequence_number_of_pdu_with_SRB_sn(unsigned char* pdu_buffer) ...@@ -123,13 +123,13 @@ uint8_t pdcp_get_sequence_number_of_pdu_with_SRB_sn(unsigned char* pdu_buffer)
* Fills the incoming buffer with the fields of the header for srb sn * Fills the incoming buffer with the fields of the header for srb sn
* *
* @param pdu_buffer PDCP PDU buffer * @param pdu_buffer PDCP PDU buffer
* @return TRUE on success, FALSE otherwise * @return true on success, false otherwise
*/ */
boolean_t pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer(unsigned char* pdu_buffer, \ bool pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer(unsigned char* pdu_buffer,
pdcp_control_plane_data_pdu_header* pdu) pdcp_control_plane_data_pdu_header* pdu)
{ {
if (pdu_buffer == NULL || pdu == NULL) { if (pdu_buffer == NULL || pdu == NULL) {
return FALSE; return false;
} }
/* /*
...@@ -138,20 +138,20 @@ boolean_t pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer(unsigned char ...@@ -138,20 +138,20 @@ boolean_t pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer(unsigned char
uint8_t sequence_number = pdu->sn; uint8_t sequence_number = pdu->sn;
pdu_buffer[0] = sequence_number & 0x1F; // 5bit sn pdu_buffer[0] = sequence_number & 0x1F; // 5bit sn
return TRUE; return true;
} }
/* /*
* Fills the incoming buffer with the fields of the header for long sn * Fills the incoming buffer with the fields of the header for long sn
* *
* @param pdu_buffer PDCP PDU buffer * @param pdu_buffer PDCP PDU buffer
* @return TRUE on success, FALSE otherwise * @return true on success, false otherwise
*/ */
boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* pdu_buffer, \ bool pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* pdu_buffer,
pdcp_user_plane_data_pdu_header_with_long_sn* pdu) pdcp_user_plane_data_pdu_header_with_long_sn* pdu)
{ {
if (pdu_buffer == NULL || pdu == NULL) { if (pdu_buffer == NULL || pdu == NULL) {
return FALSE; return false;
} }
/* /*
...@@ -170,7 +170,7 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* ...@@ -170,7 +170,7 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
pdu_buffer[0] |= 0x80; // set the first bit as 1 pdu_buffer[0] |= 0x80; // set the first bit as 1
} }
return TRUE; return true;
} }
/* /*
...@@ -178,13 +178,14 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* ...@@ -178,13 +178,14 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
* *
* @param pdu_buffer The buffer that PDU will be serialized into * @param pdu_buffer The buffer that PDU will be serialized into
* @param pdu A status report header * @param pdu A status report header
* @return TRUE on success, FALSE otherwise * @return true on success, false otherwise
*/ */
boolean_t pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer, \ bool pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer,
uint8_t bitmap[512], pdcp_control_pdu_for_pdcp_status_report* pdu) uint8_t bitmap[512],
pdcp_control_pdu_for_pdcp_status_report* pdu)
{ {
if (pdu_buffer == NULL || pdu == NULL) { if (pdu_buffer == NULL || pdu == NULL) {
return FALSE; return false;
} }
/* /*
...@@ -205,6 +206,6 @@ boolean_t pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_b ...@@ -205,6 +206,6 @@ boolean_t pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_b
*/ */
memcpy(pdu_buffer + 2, bitmap, 512); memcpy(pdu_buffer + 2, bitmap, 512);
return TRUE; return true;
} }
...@@ -142,18 +142,18 @@ uint8_t pdcp_get_sequence_number_of_pdu_with_SRB_sn(unsigned char* pdu_buffer); ...@@ -142,18 +142,18 @@ uint8_t pdcp_get_sequence_number_of_pdu_with_SRB_sn(unsigned char* pdu_buffer);
* Fills the incoming buffer with the fields of the header for SRB1 * Fills the incoming buffer with the fields of the header for SRB1
* *
* @param pdu_buffer PDCP PDU buffer * @param pdu_buffer PDCP PDU buffer
* @return TRUE on success, FALSE otherwise * @return true on success, false otherwise
*/ */
boolean_t pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer(unsigned char* pdu_buffer, \ bool pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer(unsigned char* pdu_buffer,
pdcp_control_plane_data_pdu_header* pdu); pdcp_control_plane_data_pdu_header* pdu);
/* /*
* Fills the incoming buffer with the fields of the header for long SN (RLC UM and AM) * Fills the incoming buffer with the fields of the header for long SN (RLC UM and AM)
* *
* @param pdu_buffer PDCP PDU buffer * @param pdu_buffer PDCP PDU buffer
* @return TRUE on success, FALSE otherwise * @return true on success, false otherwise
*/ */
boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* pdu_buffer, \ bool pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* pdu_buffer,
pdcp_user_plane_data_pdu_header_with_long_sn* pdu); pdcp_user_plane_data_pdu_header_with_long_sn* pdu);
/* /*
* Fills the incoming status report header with given value of bitmap * Fills the incoming status report header with given value of bitmap
...@@ -162,10 +162,11 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* ...@@ -162,10 +162,11 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
* @param FMS First Missing PDCP SN * @param FMS First Missing PDCP SN
* @param bitmap Received/Missing sequence number bitmap * @param bitmap Received/Missing sequence number bitmap
* @param pdu A status report header * @param pdu A status report header
* @return TRUE on success, FALSE otherwise * @return true on success, false otherwise
*/ */
boolean_t pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer, \ bool pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer,
uint8_t bitmap[512], pdcp_control_pdu_for_pdcp_status_report* pdu); uint8_t bitmap[512],
pdcp_control_pdu_for_pdcp_status_report* pdu);
int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP, int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP,
struct pdcp_netlink_element_s **data_ppP); struct pdcp_netlink_element_s **data_ppP);
......
...@@ -33,12 +33,12 @@ ...@@ -33,12 +33,12 @@
/* /*
* Initializes sequence numbering state * Initializes sequence numbering state
* @param pdcp_entity The PDCP entity to be initialized * @param pdcp_entity The PDCP entity to be initialized
* @return boolean_t TRUE on success, FALSE otherwise * @return bool true on success, false otherwise
*/ */
boolean_t pdcp_init_seq_numbers(pdcp_t* pdcp_entity) bool pdcp_init_seq_numbers(pdcp_t* pdcp_entity)
{ {
if (pdcp_entity == NULL) { if (pdcp_entity == NULL) {
return FALSE; return false;
} }
/* Sequence number state variables */ /* Sequence number state variables */
...@@ -55,34 +55,34 @@ boolean_t pdcp_init_seq_numbers(pdcp_t* pdcp_entity) ...@@ -55,34 +55,34 @@ boolean_t pdcp_init_seq_numbers(pdcp_t* pdcp_entity)
// Shall UE and eNB behave differently on initialization? (see 7.1.e) // Shall UE and eNB behave differently on initialization? (see 7.1.e)
pdcp_entity->last_submitted_pdcp_rx_sn = 4095; pdcp_entity->last_submitted_pdcp_rx_sn = 4095;
return TRUE; return true;
} }
boolean_t pdcp_is_seq_num_size_valid(pdcp_t* pdcp_entity) bool pdcp_is_seq_num_size_valid(pdcp_t* pdcp_entity)
{ {
if (pdcp_entity == NULL) { if (pdcp_entity == NULL) {
return FALSE; return false;
} }
// Check if the size of SN is valid (see 3GPP TS 36.323 v10.1.0 item 6.3.2) // Check if the size of SN is valid (see 3GPP TS 36.323 v10.1.0 item 6.3.2)
if (pdcp_entity->seq_num_size != 5 && pdcp_entity->seq_num_size != 7 && pdcp_entity->seq_num_size != 12) { if (pdcp_entity->seq_num_size != 5 && pdcp_entity->seq_num_size != 7 && pdcp_entity->seq_num_size != 12) {
LOG_W(PDCP, "Incoming SN size is invalid! (Expected: {5 | 7 | 12}, Received: %d\n", pdcp_entity->seq_num_size); LOG_W(PDCP, "Incoming SN size is invalid! (Expected: {5 | 7 | 12}, Received: %d\n", pdcp_entity->seq_num_size);
return FALSE; return false;
} }
return TRUE; return true;
} }
/** /**
* Check if SN number is in the range according to SN size * Check if SN number is in the range according to SN size
*/ */
boolean_t pdcp_is_seq_num_valid(uint16_t seq_num, uint8_t seq_num_size) bool pdcp_is_seq_num_valid(uint16_t seq_num, uint8_t seq_num_size)
{ {
if (seq_num >= 0 && seq_num <= pdcp_calculate_max_seq_num_for_given_size(seq_num_size)) { if (seq_num >= 0 && seq_num <= pdcp_calculate_max_seq_num_for_given_size(seq_num_size)) {
return TRUE; return true;
} }
return FALSE; return false;
} }
uint16_t pdcp_calculate_max_seq_num_for_given_size(uint8_t seq_num_size) uint16_t pdcp_calculate_max_seq_num_for_given_size(uint8_t seq_num_size)
...@@ -96,7 +96,7 @@ uint16_t pdcp_calculate_max_seq_num_for_given_size(uint8_t seq_num_size) ...@@ -96,7 +96,7 @@ uint16_t pdcp_calculate_max_seq_num_for_given_size(uint8_t seq_num_size)
uint16_t pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity) uint16_t pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity)
{ {
if (pdcp_is_seq_num_size_valid(pdcp_entity) == FALSE) { if (pdcp_is_seq_num_size_valid(pdcp_entity) == false) {
return -1; return -1;
} }
...@@ -118,10 +118,10 @@ uint16_t pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity) ...@@ -118,10 +118,10 @@ uint16_t pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity)
return pdcp_seq_num; return pdcp_seq_num;
} }
boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity) bool pdcp_advance_rx_window(pdcp_t* pdcp_entity)
{ {
if (pdcp_is_seq_num_size_valid(pdcp_entity) == FALSE) { if (pdcp_is_seq_num_size_valid(pdcp_entity) == false) {
return FALSE; return false;
} }
/* /*
...@@ -137,10 +137,10 @@ boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity) ...@@ -137,10 +137,10 @@ boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity)
pdcp_entity->next_pdcp_rx_sn++; pdcp_entity->next_pdcp_rx_sn++;
} }
return TRUE; return true;
} }
boolean_t pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entity) bool pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entity)
{ {
/* /*
* Incoming sequence number and PDCP entity were already * Incoming sequence number and PDCP entity were already
...@@ -158,5 +158,5 @@ boolean_t pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entit ...@@ -158,5 +158,5 @@ boolean_t pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entit
LOG_D(PDCP, "Marking %d. bit of %d. octet of status bitmap\n", (seq_num % 8) + 1, octet_index); LOG_D(PDCP, "Marking %d. bit of %d. octet of status bitmap\n", (seq_num % 8) + 1, octet_index);
util_mark_nth_bit_of_octet(&pdcp_entity->missing_pdu_bitmap[octet_index], seq_num % 8); util_mark_nth_bit_of_octet(&pdcp_entity->missing_pdu_bitmap[octet_index], seq_num % 8);
util_print_binary_representation((uint8_t*)"Current state of relevant octet: ", pdcp_entity->missing_pdu_bitmap[octet_index]); util_print_binary_representation((uint8_t*)"Current state of relevant octet: ", pdcp_entity->missing_pdu_bitmap[octet_index]);
return TRUE; return true;
} }
...@@ -35,17 +35,17 @@ ...@@ -35,17 +35,17 @@
* @param pdcp_entity The PDCP entity to be initialized * @param pdcp_entity The PDCP entity to be initialized
* @return none * @return none
*/ */
boolean_t pdcp_init_seq_numbers(pdcp_t* pdcp_entity); bool pdcp_init_seq_numbers(pdcp_t* pdcp_entity);
/** /**
* Checks if incoming PDCP entitiy pointer and relevant sequence number size is valid * Checks if incoming PDCP entitiy pointer and relevant sequence number size is valid
* @return TRUE (0x01) if it is valid, FALSE (0x00) otherwise * @return true (0x01) if it is valid, false (0x00) otherwise
*/ */
boolean_t pdcp_is_seq_num_size_valid(pdcp_t* pdcp_entity); bool pdcp_is_seq_num_size_valid(pdcp_t* pdcp_entity);
/** /**
* Check if SN number is in the range according to SN size * Check if SN number is in the range according to SN size
* @return TRUE if it is valid, FALSE otherwise * @return true if it is valid, false otherwise
*/ */
boolean_t pdcp_is_seq_num_valid(uint16_t seq_num, uint8_t seq_num_size); bool pdcp_is_seq_num_valid(uint16_t seq_num, uint8_t seq_num_size);
/** /**
* Returns the maximum allowed sequence number value for given size of SN field * Returns the maximum allowed sequence number value for given size of SN field
* @return Max sequence number value * @return Max sequence number value
...@@ -58,11 +58,11 @@ uint16_t pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity); ...@@ -58,11 +58,11 @@ uint16_t pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity);
/** /**
* Advances the RX window state of given PDCP entity upon successfull receipt of a SDU * Advances the RX window state of given PDCP entity upon successfull receipt of a SDU
*/ */
boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity); bool pdcp_advance_rx_window(pdcp_t* pdcp_entity);
/** /**
* Updates missing PDU bitmap with incoming sequence number * Updates missing PDU bitmap with incoming sequence number
* @return TRUE if successful, FALSE otherwise * @return true if successful, false otherwise
*/ */
boolean_t pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entity); bool pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entity);
#endif #endif
...@@ -130,9 +130,9 @@ void util_print_binary_representation(unsigned char* message, uint8_t octet) ...@@ -130,9 +130,9 @@ void util_print_binary_representation(unsigned char* message, uint8_t octet)
* *
* @param octet 8-bit data * @param octet 8-bit data
* @param index Index of bit to be set * @param index Index of bit to be set
* @return TRUE on success, FALSE otherwise * @return true on success, false otherwise
*/ */
boolean_t util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index) bool util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index)
{ {
uint8_t mask = 0x80; uint8_t mask = 0x80;
...@@ -148,6 +148,6 @@ boolean_t util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index) ...@@ -148,6 +148,6 @@ boolean_t util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index)
*/ */
*octet |= mask; *octet |= mask;
return TRUE; return true;
} }
...@@ -66,8 +66,8 @@ void util_print_binary_representation(unsigned char* message, uint8_t octet); ...@@ -66,8 +66,8 @@ void util_print_binary_representation(unsigned char* message, uint8_t octet);
* *
* @param octet Octet * @param octet Octet
* @param index Index * @param index Index
* @return TRUE on success, FALSE otherwise * @return true on success, false otherwise
*/ */
boolean_t util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index); bool util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index);
#endif // PDCP_UTIL_H #endif // PDCP_UTIL_H
...@@ -52,7 +52,7 @@ rlc_am_get_status_pdu_buffer_occupancy( ...@@ -52,7 +52,7 @@ rlc_am_get_status_pdu_buffer_occupancy(
rlc_sn_t sn_cursor = rlc_pP->vr_r; rlc_sn_t sn_cursor = rlc_pP->vr_r;
rlc_sn_t sn_prev = rlc_pP->vr_r; rlc_sn_t sn_prev = rlc_pP->vr_r;
rlc_sn_t sn_end = rlc_pP->vr_ms; rlc_sn_t sn_end = rlc_pP->vr_ms;
boolean_t segment_loop_end = false; bool segment_loop_end = false;
if (sn_prev != sn_end) { if (sn_prev != sn_end) {
while ((RLC_AM_DIFF_SN(sn_prev,rlc_pP->vr_r) < RLC_AM_DIFF_SN(sn_end,rlc_pP->vr_r)) && (cursor_p != NULL)) { while ((RLC_AM_DIFF_SN(sn_prev,rlc_pP->vr_r) < RLC_AM_DIFF_SN(sn_end,rlc_pP->vr_r)) && (cursor_p != NULL)) {
......
...@@ -54,7 +54,7 @@ typedef struct rlc_am_entity_s { ...@@ -54,7 +54,7 @@ typedef struct rlc_am_entity_s {
rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */ rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */
logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */ logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */
boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */ bool is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
rlc_buffer_occupancy_t sdu_buffer_occupancy; /*!< \brief Number of bytes of unsegmented SDUs. */ rlc_buffer_occupancy_t sdu_buffer_occupancy; /*!< \brief Number of bytes of unsegmented SDUs. */
rlc_buffer_occupancy_t status_buffer_occupancy; /*!< \brief Number of bytes of control PDUs waiting for transmission. */ rlc_buffer_occupancy_t status_buffer_occupancy; /*!< \brief Number of bytes of control PDUs waiting for transmission. */
...@@ -76,7 +76,7 @@ typedef struct rlc_am_entity_s { ...@@ -76,7 +76,7 @@ typedef struct rlc_am_entity_s {
rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer; /*!< \brief Transmission PDU data buffer. Used also for retransmissions */ rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer; /*!< \brief Transmission PDU data buffer. Used also for retransmissions */
signed int retrans_num_pdus; /*!< \brief Number of PDUs in the retransmission buffer. */ signed int retrans_num_pdus; /*!< \brief Number of PDUs in the retransmission buffer. */
signed int retrans_num_bytes_to_retransmit; /*!< \brief Number of bytes in the retransmission buffer to be retransmitted. Only payload is taken into account */ signed int retrans_num_bytes_to_retransmit; /*!< \brief Number of bytes in the retransmission buffer to be retransmitted. Only payload is taken into account */
boolean_t force_poll; /*!< \brief force poll due to t_poll_retransmit time-out. */ bool force_poll; /*!< \brief force poll due to t_poll_retransmit time-out. */
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// RX BUFFERS // RX BUFFERS
...@@ -186,8 +186,8 @@ typedef struct rlc_am_entity_s { ...@@ -186,8 +186,8 @@ typedef struct rlc_am_entity_s {
// note occupancy of other buffers is deducted from nb elements in lists // note occupancy of other buffers is deducted from nb elements in lists
rlc_buffer_occupancy_t buffer_occupancy_retransmission_buffer; /*!< \brief Number of PDUs. */ rlc_buffer_occupancy_t buffer_occupancy_retransmission_buffer; /*!< \brief Number of PDUs. */
boolean_t initialized; /*!< \brief Boolean for rlc_am_entity_t struct initialization. */ bool initialized; /*!< \brief Boolean for rlc_am_entity_t struct initialization. */
boolean_t configured; /*!< \brief Boolean for rlc_am_entity_t struct configuration. */ bool configured; /*!< \brief Boolean for rlc_am_entity_t struct configuration. */
} rlc_am_entity_t; } rlc_am_entity_t;
/** @} */ /** @} */
# endif # endif
...@@ -32,7 +32,7 @@ rlc_am_init( ...@@ -32,7 +32,7 @@ rlc_am_init(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlc_pP) rlc_am_entity_t *const rlc_pP)
{ {
if (rlc_pP->initialized == TRUE) { if (rlc_pP->initialized == true) {
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] INITIALIZATION ALREADY DONE, DOING NOTHING\n", LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] INITIALIZATION ALREADY DONE, DOING NOTHING\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
} else { } else {
...@@ -79,7 +79,7 @@ rlc_am_init( ...@@ -79,7 +79,7 @@ rlc_am_init(
rlc_pP->last_absolute_subframe_status_indication = 0xFFFFFFFF; // any value > 1 rlc_pP->last_absolute_subframe_status_indication = 0xFFFFFFFF; // any value > 1
rlc_pP->initialized = TRUE; rlc_pP->initialized = true;
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -134,7 +134,7 @@ rlc_am_reestablish( ...@@ -134,7 +134,7 @@ rlc_am_reestablish(
rlc_pP->last_absolute_subframe_status_indication = 0xFFFFFFFF; // any value > 1 rlc_pP->last_absolute_subframe_status_indication = 0xFFFFFFFF; // any value > 1
rlc_pP->initialized = TRUE; rlc_pP->initialized = true;
} }
...@@ -197,7 +197,7 @@ rlc_am_configure( ...@@ -197,7 +197,7 @@ rlc_am_configure(
const uint32_t t_reorderingP, const uint32_t t_reorderingP,
const uint32_t t_status_prohibitP) const uint32_t t_status_prohibitP)
{ {
if (rlc_pP->configured == TRUE) { if (rlc_pP->configured == true) {
LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RECONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n", LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RECONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
max_retx_thresholdP, max_retx_thresholdP,
...@@ -235,7 +235,7 @@ rlc_am_configure( ...@@ -235,7 +235,7 @@ rlc_am_configure(
rlc_am_init_timer_reordering (ctxt_pP, rlc_pP, t_reorderingP); rlc_am_init_timer_reordering (ctxt_pP, rlc_pP, t_reorderingP);
rlc_am_init_timer_status_prohibit(ctxt_pP, rlc_pP, t_status_prohibitP); rlc_am_init_timer_status_prohibit(ctxt_pP, rlc_pP, t_status_prohibitP);
rlc_pP->configured = TRUE; rlc_pP->configured = true;
} }
} }
......
...@@ -183,12 +183,10 @@ rlc_am_send_sdu ( ...@@ -183,12 +183,10 @@ rlc_am_send_sdu (
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void rlc_am_reassemble_pdu(const protocol_ctxt_t *const ctxt_pP,
rlc_am_reassemble_pdu( rlc_am_entity_t *const rlc_pP,
const protocol_ctxt_t *const ctxt_pP, mem_block_t *const tb_pP,
rlc_am_entity_t *const rlc_pP, bool free_rlc_pdu) {
mem_block_t *const tb_pP,
boolean_t free_rlc_pdu) {
int i,j; int i,j;
rlc_am_pdu_info_t *pdu_info = &((rlc_am_rx_pdu_management_t *)(tb_pP->data))->pdu_info; rlc_am_pdu_info_t *pdu_info = &((rlc_am_rx_pdu_management_t *)(tb_pP->data))->pdu_info;
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[REASSEMBLY PDU] TRY REASSEMBLY PDU SN=%03d\n", LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[REASSEMBLY PDU] TRY REASSEMBLY PDU SN=%03d\n",
......
...@@ -57,14 +57,14 @@ void rlc_am_reassembly (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * ...@@ -57,14 +57,14 @@ void rlc_am_reassembly (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t *
*/ */
void rlc_am_send_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP); void rlc_am_send_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP);
/*! \fn void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const mem_block_t* const tb_pP,boolean_t free_rlc_pdu) /*! \fn void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const mem_block_t* const tb_pP, bool free_rlc_pdu)
* \brief Reassembly a RLC AM PDU, depending of the content of this PDU, data will be reassemblied to the current output SDU, the current will be sent to higher layers or not, after or before the reassembly, or no send of SDU will be triggered, depending on FI field in PDU header. * \brief Reassembly a RLC AM PDU, depending of the content of this PDU, data will be reassemblied to the current output SDU, the current will be sent to higher layers or not, after or before the reassembly, or no send of SDU will be triggered, depending on FI field in PDU header.
* \param[in] ctxtP Running context. * \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] tb_pP RLC AM PDU embedded in a mem_block_t. * \param[in] tb_pP RLC AM PDU embedded in a mem_block_t.
* \param[in] free_rlc_pdu Flag for freeing RLC AM PDU after reassembly. * \param[in] free_rlc_pdu Flag for freeing RLC AM PDU after reassembly.
*/ */
void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, mem_block_t* const tb_pP,boolean_t free_rlc_pdu); void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, mem_block_t* const tb_pP, bool free_rlc_pdu);
/** @} */ /** @} */
#endif #endif
...@@ -328,7 +328,7 @@ rlc_am_receive_process_data_pdu ( ...@@ -328,7 +328,7 @@ rlc_am_receive_process_data_pdu (
rlc_am_pdu_info_t* pdu_info_p = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info; rlc_am_pdu_info_t* pdu_info_p = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info;
rlc_am_pdu_sn_10_t* rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)first_byte_pP; rlc_am_pdu_sn_10_t* rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)first_byte_pP;
rlc_am_rx_pdu_status_t pdu_status = RLC_AM_DATA_PDU_STATUS_OK; rlc_am_rx_pdu_status_t pdu_status = RLC_AM_DATA_PDU_STATUS_OK;
boolean_t reassemble = false; bool reassemble = false;
if (rlc_am_get_data_pdu_infos(ctxt_pP,rlc_pP, rlc_am_pdu_sn_10_p, tb_size_in_bytesP, pdu_info_p) >= 0) { if (rlc_am_get_data_pdu_infos(ctxt_pP,rlc_pP, rlc_am_pdu_sn_10_p, tb_size_in_bytesP, pdu_info_p) >= 0) {
......
...@@ -29,13 +29,12 @@ ...@@ -29,13 +29,12 @@
#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/MAC/mac_extern.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
boolean_t rlc_am_nack_pdu ( bool rlc_am_nack_pdu(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlc_pP,
rlc_am_entity_t *const rlc_pP, const rlc_sn_t snP,
const rlc_sn_t snP, const rlc_sn_t prev_nack_snP,
const rlc_sn_t prev_nack_snP, sdu_size_t so_startP,
sdu_size_t so_startP, sdu_size_t so_endP)
sdu_size_t so_endP)
{ {
// 5.2.1 Retransmission // 5.2.1 Retransmission
// ... // ...
...@@ -54,8 +53,8 @@ boolean_t rlc_am_nack_pdu ( ...@@ -54,8 +53,8 @@ boolean_t rlc_am_nack_pdu (
rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE]; rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE];
//int pdu_sdu_index; //int pdu_sdu_index;
//int sdu_index; //int sdu_index;
boolean_t status = TRUE; bool status = true;
boolean_t retx_count_increment = FALSE; bool retx_count_increment = false;
sdu_size_t pdu_data_to_retx = 0; sdu_size_t pdu_data_to_retx = 0;
if (mb_p != NULL) { if (mb_p != NULL) {
...@@ -63,7 +62,7 @@ boolean_t rlc_am_nack_pdu ( ...@@ -63,7 +62,7 @@ boolean_t rlc_am_nack_pdu (
if(so_startP > so_endP) { if(so_startP > so_endP) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU, so_startP %d, so_endP %d\n", LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU, so_startP %d, so_endP %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),so_startP, so_endP); PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),so_startP, so_endP);
status = FALSE; status = false;
} }
// Handle full PDU NACK first // Handle full PDU NACK first
else if ((so_startP == 0) && (so_endP == 0x7FFF)) { else if ((so_startP == 0) && (so_endP == 0x7FFF)) {
...@@ -71,9 +70,7 @@ boolean_t rlc_am_nack_pdu ( ...@@ -71,9 +70,7 @@ boolean_t rlc_am_nack_pdu (
pdu_data_to_retx = tx_data_pdu_buffer_p->payload_size; pdu_data_to_retx = tx_data_pdu_buffer_p->payload_size;
/* Increment VtReTxNext if this is the first NACK or if some segments have already been transmitted */ /* Increment VtReTxNext if this is the first NACK or if some segments have already been transmitted */
if ((tx_data_pdu_buffer_p->flags.retransmit == 0) || (tx_data_pdu_buffer_p->nack_so_start)) if ((tx_data_pdu_buffer_p->flags.retransmit == 0) || (tx_data_pdu_buffer_p->nack_so_start))
{ retx_count_increment = true;
retx_count_increment = TRUE;
}
tx_data_pdu_buffer_p->nack_so_start = 0; tx_data_pdu_buffer_p->nack_so_start = 0;
tx_data_pdu_buffer_p->num_holes = 0; tx_data_pdu_buffer_p->num_holes = 0;
...@@ -89,11 +86,11 @@ boolean_t rlc_am_nack_pdu ( ...@@ -89,11 +86,11 @@ boolean_t rlc_am_nack_pdu (
if(tx_data_pdu_buffer_p->nack_so_start >= tx_data_pdu_buffer_p->payload_size){ if(tx_data_pdu_buffer_p->nack_so_start >= tx_data_pdu_buffer_p->payload_size){
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU, nack_so_start %d, payload_size %d\n", LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU, nack_so_start %d, payload_size %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->payload_size); PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->payload_size);
status = FALSE; status = false;
} }
} }
else { else {
status = FALSE; status = false;
} }
} }
else if (tx_data_pdu_buffer_p->flags.max_retransmit == 0) { else if (tx_data_pdu_buffer_p->flags.max_retransmit == 0) {
...@@ -107,9 +104,8 @@ boolean_t rlc_am_nack_pdu ( ...@@ -107,9 +104,8 @@ boolean_t rlc_am_nack_pdu (
if (prev_nack_snP != snP) { if (prev_nack_snP != snP) {
/* New NACK_SN with SO */ /* New NACK_SN with SO */
/* check whether a new segment is to be placed in Retransmission Buffer, then increment vrReTx */ /* check whether a new segment is to be placed in Retransmission Buffer, then increment vrReTx */
if ((tx_data_pdu_buffer_p->flags.retransmit == 0) || (so_startP < tx_data_pdu_buffer_p->nack_so_start)) { if ((tx_data_pdu_buffer_p->flags.retransmit == 0) || (so_startP < tx_data_pdu_buffer_p->nack_so_start))
retx_count_increment = TRUE; retx_count_increment = true;
}
tx_data_pdu_buffer_p->num_holes = 1; tx_data_pdu_buffer_p->num_holes = 1;
tx_data_pdu_buffer_p->retx_hole_index = 0; tx_data_pdu_buffer_p->retx_hole_index = 0;
...@@ -129,21 +125,18 @@ boolean_t rlc_am_nack_pdu ( ...@@ -129,21 +125,18 @@ boolean_t rlc_am_nack_pdu (
tx_data_pdu_buffer_p->nack_so_stop = so_endP; tx_data_pdu_buffer_p->nack_so_stop = so_endP;
tx_data_pdu_buffer_p->num_holes ++; tx_data_pdu_buffer_p->num_holes ++;
pdu_data_to_retx = so_endP - so_startP + 1; pdu_data_to_retx = so_endP - so_startP + 1;
} else {
status = false;
} }
else { } else {
status = FALSE; status = false;
}
}
else {
status = FALSE;
} }
} }
else { else {
status = FALSE; status = false;
} }
} } else {
else { status = false;
status = FALSE;
} }
if (status) { if (status) {
...@@ -175,17 +168,16 @@ boolean_t rlc_am_nack_pdu ( ...@@ -175,17 +168,16 @@ boolean_t rlc_am_nack_pdu (
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU SN %05d\n", LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU SN %05d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
snP); snP);
status = FALSE; status = false;
} }
return status; return status;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_ack_pdu ( void rlc_am_ack_pdu(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlc_pP,
rlc_am_entity_t *const rlc_pP, const rlc_sn_t snP,
const rlc_sn_t snP, bool free_pdu)
boolean_t free_pdu)
{ {
mem_block_t* mb_p = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block; mem_block_t* mb_p = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block;
rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE]; rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE];
...@@ -283,7 +275,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -283,7 +275,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
sdu_size_t retx_so_start,retx_so_stop; //starting and ending SO for retransmission in this PDU sdu_size_t retx_so_start,retx_so_stop; //starting and ending SO for retransmission in this PDU
rlc_sn_t sn = pdu_mngt->sn; rlc_sn_t sn = pdu_mngt->sn;
uint16_t header_so_part; uint16_t header_so_part;
boolean_t fi_start, fi_end; bool fi_start, fi_end;
uint8_t sdu_index = 0; uint8_t sdu_index = 0;
uint8_t sdu_segment_index = 0; uint8_t sdu_segment_index = 0;
uint8_t num_LIs_pdu_segment = pdu_mngt->nb_sdus - 1; uint8_t num_LIs_pdu_segment = pdu_mngt->nb_sdus - 1;
...@@ -377,11 +369,11 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -377,11 +369,11 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
/* Set FI part to false if SO Start and SO End are different from PDU boundaries */ /* Set FI part to false if SO Start and SO End are different from PDU boundaries */
if (retx_so_start) if (retx_so_start)
{ {
fi_start = FALSE; fi_start = false;
} }
if (retx_so_stop < pdu_mngt->payload_size - 1) if (retx_so_stop < pdu_mngt->payload_size - 1)
{ {
fi_end = FALSE; fi_end = false;
} }
/* Header content is filled at the end */ /* Header content is filled at the end */
...@@ -423,7 +415,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -423,7 +415,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
else else
{ {
/* if retx_so_start is still not included then set data_size with full original PDU data size */ /* if retx_so_start is still not included then set data_size with full original PDU data size */
/* Set fi_start to FALSE in this case */ /* Set fi_start to false in this case */
data_size = pdu_mngt->payload_size; data_size = pdu_mngt->payload_size;
} }
sdu_index ++; sdu_index ++;
...@@ -432,7 +424,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -432,7 +424,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
if (retx_so_start == data_size) if (retx_so_start == data_size)
{ {
/* Set FI Start if retx_so_start = cumulated data size */ /* Set FI Start if retx_so_start = cumulated data size */
fi_start = TRUE; fi_start = true;
/* there must be at least one SDU more */ /* there must be at least one SDU more */
//Assertion(eNB)_PRAN_DesignDocument_annex No.778 //Assertion(eNB)_PRAN_DesignDocument_annex No.778
if(sdu_index >= pdu_mngt->nb_sdus) if(sdu_index >= pdu_mngt->nb_sdus)
...@@ -464,8 +456,8 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -464,8 +456,8 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
} }
else if (retx_so_start != 0) else if (retx_so_start != 0)
{ {
/* in all other cases set fi_start to FALSE if it SO Start is not 0 */ /* in all other cases set fi_start to false if it SO Start is not 0 */
fi_start = FALSE; fi_start = false;
} }
/* Set first SDU portion of the segment */ /* Set first SDU portion of the segment */
...@@ -582,10 +574,10 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -582,10 +574,10 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
"RLC AM Tx PDU Segment Data Error: retx_so_stop=%d OriginalPDUDataLength=%d SOStart=%d SegmentLength=%d numLISegment=%d numLIPDU=%d sn=%d LcId=%d !\n", "RLC AM Tx PDU Segment Data Error: retx_so_stop=%d OriginalPDUDataLength=%d SOStart=%d SegmentLength=%d numLISegment=%d numLIPDU=%d sn=%d LcId=%d !\n",
retx_so_stop,pdu_mngt->payload_size,retx_so_start,*payload_sizeP,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id); retx_so_stop,pdu_mngt->payload_size,retx_so_start,*payload_sizeP,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id);
*/ */
/* init FI End to FALSE if retx_so_stop is not end of PDU */ /* init FI End to false if retx_so_stop is not end of PDU */
if (retx_so_stop != pdu_mngt->payload_size - 1) if (retx_so_stop != pdu_mngt->payload_size - 1)
{ {
fi_end = FALSE; fi_end = false;
} }
/* Check consistency between sdus_segment_size and payload_sizeP */ /* Check consistency between sdus_segment_size and payload_sizeP */
...@@ -596,7 +588,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -596,7 +588,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
data_size += sdus_segment_size[i]; data_size += sdus_segment_size[i];
if ((retx_so_stop == data_size - 1) && (i < num_LIs_pdu_segment)) if ((retx_so_stop == data_size - 1) && (i < num_LIs_pdu_segment))
{ {
fi_end = TRUE; fi_end = true;
} }
} }
//Assertion(eNB)_PRAN_DesignDocument_annex No.782 //Assertion(eNB)_PRAN_DesignDocument_annex No.782
...@@ -665,7 +657,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -665,7 +657,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
pdu_mngt->nack_so_start = pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index]; pdu_mngt->nack_so_start = pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index];
} }
/* Content is supposed to be init with 0 so with FIStart=FIEnd=TRUE */ /* Content is supposed to be init with 0 so with FIStart=FIEnd=true */
RLC_AM_PDU_SET_D_C(*pdu_segment_header_p); RLC_AM_PDU_SET_D_C(*pdu_segment_header_p);
RLC_AM_PDU_SET_RF(*pdu_segment_header_p); RLC_AM_PDU_SET_RF(*pdu_segment_header_p);
/* Change FI */ /* Change FI */
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
# ifndef __RLC_AM_RETRANSMIT_H__ # ifndef __RLC_AM_RETRANSMIT_H__
# define __RLC_AM_RETRANSMIT_H__ # define __RLC_AM_RETRANSMIT_H__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/*! \fn boolean_t rlc_am_nack_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, int16_t snP, int16_t prev_nack_snP,sdu_size_t so_startP, sdu_size_t so_endP) /*! \fn bool rlc_am_nack_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, int16_t snP, int16_t prev_nack_snP,sdu_size_t so_startP, sdu_size_t so_endP)
* \brief The RLC AM PDU which have the sequence number snP is marked NACKed with segment offset fields. * \brief The RLC AM PDU which have the sequence number snP is marked NACKed with segment offset fields.
* \param[in] ctxtP Running context. * \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
...@@ -46,13 +46,12 @@ ...@@ -46,13 +46,12 @@
* \return OK/KO * \return OK/KO
* \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU. * \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU.
*/ */
boolean_t rlc_am_nack_pdu ( bool rlc_am_nack_pdu(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP,
rlc_am_entity_t *const rlcP, const rlc_sn_t snP,
const rlc_sn_t snP, const rlc_sn_t prev_nack_snP,
const rlc_sn_t prev_nack_snP, sdu_size_t so_startP,
sdu_size_t so_startP, sdu_size_t so_endP);
sdu_size_t so_endP);
/*! \fn void rlc_am_ack_pdu (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *rlcP, rlc_sn_t snP) /*! \fn void rlc_am_ack_pdu (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *rlcP, rlc_sn_t snP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. * \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
...@@ -62,11 +61,10 @@ boolean_t rlc_am_nack_pdu ( ...@@ -62,11 +61,10 @@ boolean_t rlc_am_nack_pdu (
* \param[in] free_pdu Boolean indicating that the PDU can be freed because smaller than new vtA. * \param[in] free_pdu Boolean indicating that the PDU can be freed because smaller than new vtA.
* \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU. * \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU.
*/ */
void rlc_am_ack_pdu ( void rlc_am_ack_pdu(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP,
rlc_am_entity_t *const rlcP, const rlc_sn_t snP,
const rlc_sn_t snP, bool free_pdu);
boolean_t free_pdu);
/*! \fn mem_block_t* rlc_am_retransmit_get_copy (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, rlc_sn_t snP) /*! \fn mem_block_t* rlc_am_retransmit_get_copy (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, rlc_sn_t snP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. * \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
......
...@@ -31,14 +31,13 @@ ...@@ -31,14 +31,13 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
boolean_t rlc_am_rx_check_vr_reassemble( bool rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t* const rlc_pP)
const rlc_am_entity_t* const rlc_pP)
{ {
mem_block_t* cursor_p = rlc_pP->receiver_buffer.head; mem_block_t* cursor_p = rlc_pP->receiver_buffer.head;
rlc_am_rx_pdu_management_t * pdu_cursor_mgnt_p = NULL; rlc_am_rx_pdu_management_t * pdu_cursor_mgnt_p = NULL;
sdu_size_t next_waited_so = 0; sdu_size_t next_waited_so = 0;
boolean_t reassemble = FALSE; bool reassemble = false;
if (cursor_p != NULL) { if (cursor_p != NULL) {
...@@ -48,7 +47,7 @@ boolean_t rlc_am_rx_check_vr_reassemble( ...@@ -48,7 +47,7 @@ boolean_t rlc_am_rx_check_vr_reassemble(
if (sn_ref != rlc_pP->vr_r) { if (sn_ref != rlc_pP->vr_r) {
/* Case vrR has advanced from head : most likely case */ /* Case vrR has advanced from head : most likely case */
reassemble = TRUE; reassemble = true;
/* Handle first SN if it is made of PDU segments : set them all to be reassembled */ /* Handle first SN if it is made of PDU segments : set them all to be reassembled */
if (pdu_info_p->rf) { if (pdu_info_p->rf) {
pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data); pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
...@@ -58,7 +57,7 @@ boolean_t rlc_am_rx_check_vr_reassemble( ...@@ -58,7 +57,7 @@ boolean_t rlc_am_rx_check_vr_reassemble(
{ {
LOG_E(RLC, "AM Rx Check Reassembly head SN=%d with PDU segments != vrR=%d should be fully received LCID=%d\n", LOG_E(RLC, "AM Rx Check Reassembly head SN=%d with PDU segments != vrR=%d should be fully received LCID=%d\n",
sn_ref,rlc_pP->vr_r,rlc_pP->channel_id); sn_ref,rlc_pP->vr_r,rlc_pP->channel_id);
return FALSE; return false;
} }
/* /*
AssertFatal(pdu_cursor_mgnt_p->all_segments_received > 0,"AM Rx Check Reassembly head SN=%d with PDU segments != vrR=%d should be fully received LCID=%d\n", AssertFatal(pdu_cursor_mgnt_p->all_segments_received > 0,"AM Rx Check Reassembly head SN=%d with PDU segments != vrR=%d should be fully received LCID=%d\n",
...@@ -94,7 +93,7 @@ boolean_t rlc_am_rx_check_vr_reassemble( ...@@ -94,7 +93,7 @@ boolean_t rlc_am_rx_check_vr_reassemble(
{ {
LOG_E(RLC, "AM Rx Check Reassembly vr=%d should be partly received SNHead=%d LCID=%d\n", LOG_E(RLC, "AM Rx Check Reassembly vr=%d should be partly received SNHead=%d LCID=%d\n",
rlc_pP->vr_r,sn_ref,rlc_pP->channel_id); rlc_pP->vr_r,sn_ref,rlc_pP->channel_id);
return FALSE; return false;
} }
/* /*
AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly vr=%d should be partly received SNHead=%d LCID=%d\n", AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly vr=%d should be partly received SNHead=%d LCID=%d\n",
...@@ -123,7 +122,7 @@ boolean_t rlc_am_rx_check_vr_reassemble( ...@@ -123,7 +122,7 @@ boolean_t rlc_am_rx_check_vr_reassemble(
{ {
LOG_E(RLC, "AM Rx Check Reassembly SNHead=vr=%d should be partly received LCID=%d\n", LOG_E(RLC, "AM Rx Check Reassembly SNHead=vr=%d should be partly received LCID=%d\n",
rlc_pP->vr_r,rlc_pP->channel_id); rlc_pP->vr_r,rlc_pP->channel_id);
return FALSE; return false;
} }
/* /*
AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly SNHead=vr=%d should be partly received LCID=%d\n", AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly SNHead=vr=%d should be partly received LCID=%d\n",
...@@ -132,7 +131,7 @@ boolean_t rlc_am_rx_check_vr_reassemble( ...@@ -132,7 +131,7 @@ boolean_t rlc_am_rx_check_vr_reassemble(
while ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r) && (pdu_info_p->so == next_waited_so)) { while ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r) && (pdu_info_p->so == next_waited_so)) {
if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) { if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) {
pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING; pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING;
reassemble = TRUE; reassemble = true;
} }
next_waited_so += pdu_info_p->payload_size; next_waited_so += pdu_info_p->payload_size;
cursor_p = cursor_p->next; cursor_p = cursor_p->next;
...@@ -157,7 +156,7 @@ mem_block_t * create_new_segment_from_pdu( ...@@ -157,7 +156,7 @@ mem_block_t * create_new_segment_from_pdu(
int16_t new_li_list[RLC_AM_MAX_SDU_IN_PDU]; int16_t new_li_list[RLC_AM_MAX_SDU_IN_PDU];
int16_t header_size = 0; int16_t header_size = 0;
uint8_t num_li = 0; uint8_t num_li = 0;
boolean_t fi_start, fi_end, lsf; bool fi_start, fi_end, lsf;
/* Init some PDU Segment header fixed parameters */ /* Init some PDU Segment header fixed parameters */
fi_start = !((pdu_rx_info_p->fi & 0x2) >> 1); fi_start = !((pdu_rx_info_p->fi & 0x2) >> 1);
...@@ -170,11 +169,11 @@ mem_block_t * create_new_segment_from_pdu( ...@@ -170,11 +169,11 @@ mem_block_t * create_new_segment_from_pdu(
header_size = RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE; header_size = RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE;
if (so_offset) { if (so_offset) {
fi_start = FALSE; fi_start = false;
} }
if (so_offset + data_length_to_copy != pdu_rx_info_p->payload_size) { if (so_offset + data_length_to_copy != pdu_rx_info_p->payload_size) {
fi_end = FALSE; fi_end = false;
lsf = FALSE; lsf = false;
} }
} // end no LI in original segment } // end no LI in original segment
else { else {
...@@ -185,7 +184,7 @@ mem_block_t * create_new_segment_from_pdu( ...@@ -185,7 +184,7 @@ mem_block_t * create_new_segment_from_pdu(
/* set LSF to false if we know that end of the original segment will not be copied */ /* set LSF to false if we know that end of the original segment will not be copied */
if (so_offset + data_length_to_copy != pdu_rx_info_p->payload_size) { if (so_offset + data_length_to_copy != pdu_rx_info_p->payload_size) {
lsf = FALSE; lsf = false;
} }
/* catch the first LI containing so_offset */ /* catch the first LI containing so_offset */
...@@ -223,7 +222,7 @@ mem_block_t * create_new_segment_from_pdu( ...@@ -223,7 +222,7 @@ mem_block_t * create_new_segment_from_pdu(
num_li = j; num_li = j;
/* set FI End if remaining size = 0 */ /* set FI End if remaining size = 0 */
if (remaining_size == 0) { if (remaining_size == 0) {
fi_end = TRUE; fi_end = true;
} }
} }
} }
...@@ -263,7 +262,7 @@ mem_block_t * create_new_segment_from_pdu( ...@@ -263,7 +262,7 @@ mem_block_t * create_new_segment_from_pdu(
} }
/* Fill Header part in the buffer */ /* Fill Header part in the buffer */
/* Content is supposed to be init with 0 so with FIStart=FIEnd=TRUE */ /* Content is supposed to be init with 0 so with FIStart=FIEnd=true */
/* copy first two bytes from original: D/C + RF + FI + E+ SN*/ /* copy first two bytes from original: D/C + RF + FI + E+ SN*/
memset(pdu_segment_header_p, 0, header_size); memset(pdu_segment_header_p, 0, header_size);
RLC_AM_PDU_SET_D_C(*pdu_segment_header_p); RLC_AM_PDU_SET_D_C(*pdu_segment_header_p);
...@@ -1106,7 +1105,7 @@ rlc_am_rx_list_reassemble_rlc_sdus( ...@@ -1106,7 +1105,7 @@ rlc_am_rx_list_reassemble_rlc_sdus(
do { do {
if (rlc_am_rx_pdu_management_p->all_segments_received > 0) { if (rlc_am_rx_pdu_management_p->all_segments_received > 0) {
cursor_p = list2_remove_head(&rlc_pP->receiver_buffer); cursor_p = list2_remove_head(&rlc_pP->receiver_buffer);
rlc_am_reassemble_pdu(ctxt_pP, rlc_pP, cursor_p,TRUE); rlc_am_reassemble_pdu(ctxt_pP, rlc_pP, cursor_p, true);
rlc_am_rx_old_pdu_management = rlc_am_rx_pdu_management_p; rlc_am_rx_old_pdu_management = rlc_am_rx_pdu_management_p;
cursor_p = list2_get_head(&rlc_pP->receiver_buffer); cursor_p = list2_get_head(&rlc_pP->receiver_buffer);
...@@ -1123,7 +1122,7 @@ rlc_am_rx_list_reassemble_rlc_sdus( ...@@ -1123,7 +1122,7 @@ rlc_am_rx_list_reassemble_rlc_sdus(
else if (rlc_am_rx_pdu_management_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING) { else if (rlc_am_rx_pdu_management_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING) {
rlc_am_rx_pdu_management_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLED; rlc_am_rx_pdu_management_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLED;
rlc_am_reassemble_pdu(ctxt_pP, rlc_pP, cursor_p,FALSE); rlc_am_reassemble_pdu(ctxt_pP, rlc_pP, cursor_p, false);
rlc_am_rx_old_pdu_management = rlc_am_rx_pdu_management_p; rlc_am_rx_old_pdu_management = rlc_am_rx_pdu_management_p;
cursor_p = cursor_p->next; cursor_p = cursor_p->next;
......
...@@ -61,13 +61,13 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_insert_pdu(const protocol_ ...@@ -61,13 +61,13 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_insert_pdu(const protocol_
*/ */
signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP); signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP);
/*! \fn boolean_t rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP) /*! \fn bool rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP)
* \brief Check if reassembly taking into account potential new vrR value * \brief Check if reassembly taking into account potential new vrR value
* \param[in] ctxt_pP Running context. * \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \return TRUE if reassembly must be done, FALSE else * \return true if reassembly must be done, false else
*/ */
boolean_t rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP); bool rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP);
/*! \fn void rlc_am_rx_check_all_byte_segments(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP) /*! \fn void rlc_am_rx_check_all_byte_segments(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP)
* \brief Check if all sub-segments of a PDU are received, if yes then call rlc_am_rx_mark_all_segments_received() procedure. * \brief Check if all sub-segments of a PDU are received, if yes then call rlc_am_rx_mark_all_segments_received() procedure.
......
...@@ -32,12 +32,11 @@ ...@@ -32,12 +32,11 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_pdu_polling ( void rlc_am_pdu_polling(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlc_pP,
rlc_am_entity_t *const rlc_pP, rlc_am_pdu_sn_10_t *const pdu_pP,
rlc_am_pdu_sn_10_t *const pdu_pP, const int16_t payload_sizeP,
const int16_t payload_sizeP, bool is_new_pdu)
boolean_t is_new_pdu)
{ {
// 5.2.2 Polling // 5.2.2 Polling
// An AM RLC entity can poll its peer AM RLC entity in order to trigger STATUS reporting at the peer AM RLC entity. // An AM RLC entity can poll its peer AM RLC entity in order to trigger STATUS reporting at the peer AM RLC entity.
......
...@@ -36,14 +36,14 @@ ...@@ -36,14 +36,14 @@
# define __RLC_AM_SEGMENT_H__ # define __RLC_AM_SEGMENT_H__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/*! \fn void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP,boolean_t is_new_pdu) /*! \fn void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP, bool is_new_pdu)
* \brief Set or not the poll bit in the PDU header depending on RLC AM protocol variables. * \brief Set or not the poll bit in the PDU header depending on RLC AM protocol variables.
* \param[in] ctxt_pP Running context. * \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] pduP Pointer on the header of the PDU in order to be able to set the poll bit if necessary. * \param[in] pduP Pointer on the header of the PDU in order to be able to set the poll bit if necessary.
* \param[in] payload_sizeP Size of the payload of the PDU. * \param[in] payload_sizeP Size of the payload of the PDU.
*/ */
void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP,boolean_t is_new_pdu); void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP, bool is_new_pdu);
/*! \fn void rlc_am_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP) /*! \fn void rlc_am_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP)
* \brief Segment a PDU with 10 bits sequence number, based on segmentation information given by MAC (size to transmit). * \brief Segment a PDU with 10 bits sequence number, based on segmentation information given by MAC (size to transmit).
......
...@@ -237,7 +237,7 @@ rlc_am_receive_process_control_pdu( ...@@ -237,7 +237,7 @@ rlc_am_receive_process_control_pdu(
rlc_sn_t nack_sn,prev_nack_sn; rlc_sn_t nack_sn,prev_nack_sn;
sdu_size_t data_cnf_so_stop = 0x7FFF; sdu_size_t data_cnf_so_stop = 0x7FFF;
unsigned int nack_index; unsigned int nack_index;
boolean_t status = TRUE; bool status = true;
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, tb_size_in_bytes_pP, &rlc_pP->control_pdu_info) >= 0) { if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, tb_size_in_bytes_pP, &rlc_pP->control_pdu_info) >= 0) {
rlc_am_tx_buffer_display(ctxt_pP, rlc_pP, " TX BUFFER BEFORE PROCESS OF STATUS PDU"); rlc_am_tx_buffer_display(ctxt_pP, rlc_pP, " TX BUFFER BEFORE PROCESS OF STATUS PDU");
...@@ -282,7 +282,7 @@ rlc_am_receive_process_control_pdu( ...@@ -282,7 +282,7 @@ rlc_am_receive_process_control_pdu(
if (RLC_AM_DIFF_SN(rlc_pP->vt_s,rlc_pP->vt_a) >= RLC_AM_DIFF_SN(ack_sn,rlc_pP->vt_a)) { if (RLC_AM_DIFF_SN(rlc_pP->vt_s,rlc_pP->vt_a) >= RLC_AM_DIFF_SN(ack_sn,rlc_pP->vt_a)) {
if (rlc_pP->control_pdu_info.num_nack == 0) { if (rlc_pP->control_pdu_info.num_nack == 0) {
while (sn_cursor != ack_sn) { while (sn_cursor != ack_sn) {
rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor,TRUE); rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor, true);
sn_cursor = RLC_AM_NEXT_SN(sn_cursor); sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
} }
...@@ -294,7 +294,7 @@ rlc_am_receive_process_control_pdu( ...@@ -294,7 +294,7 @@ rlc_am_receive_process_control_pdu(
prev_nack_sn = 0x3FFF; prev_nack_sn = 0x3FFF;
while (sn_cursor != nack_sn) { while (sn_cursor != nack_sn) {
rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor,TRUE); rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor, true);
sn_cursor = RLC_AM_NEXT_SN(sn_cursor); sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
} }
...@@ -316,7 +316,7 @@ rlc_am_receive_process_control_pdu( ...@@ -316,7 +316,7 @@ rlc_am_receive_process_control_pdu(
rlc_am_ack_pdu(ctxt_pP, rlc_am_ack_pdu(ctxt_pP,
rlc_pP, rlc_pP,
sn_cursor, sn_cursor,
FALSE); false);
} else { } else {
status = rlc_am_nack_pdu (ctxt_pP, status = rlc_am_nack_pdu (ctxt_pP,
rlc_pP, rlc_pP,
...@@ -348,13 +348,13 @@ rlc_am_receive_process_control_pdu( ...@@ -348,13 +348,13 @@ rlc_am_receive_process_control_pdu(
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" WARNING CONTROL PDU ACK SN %d OUT OF WINDOW vtA=%d vtS=%d\n", LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" WARNING CONTROL PDU ACK SN %d OUT OF WINDOW vtA=%d vtS=%d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),ack_sn,rlc_pP->vt_a,rlc_pP->vt_s); PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),ack_sn,rlc_pP->vt_a,rlc_pP->vt_s);
*tb_size_in_bytes_pP = 0; *tb_size_in_bytes_pP = 0;
status = FALSE; status = false;
} }
} else { } else {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" ERROR IN DECODING CONTROL PDU\n", LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" ERROR IN DECODING CONTROL PDU\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
*tb_size_in_bytes_pP = 0; *tb_size_in_bytes_pP = 0;
status = FALSE; status = false;
} }
if (status) { if (status) {
...@@ -480,8 +480,8 @@ rlc_am_send_status_pdu( ...@@ -480,8 +480,8 @@ rlc_am_send_status_pdu(
int waited_so = 0; int waited_so = 0;
mem_block_t *tb_p = NULL; mem_block_t *tb_p = NULL;
sdu_size_t pdu_size = 0; sdu_size_t pdu_size = 0;
boolean_t status_report_completed = false; bool status_report_completed = false;
boolean_t segment_loop_end = false; bool segment_loop_end = false;
memset(&control_pdu_info, 0, sizeof(rlc_am_control_pdu_info_t)); memset(&control_pdu_info, 0, sizeof(rlc_am_control_pdu_info_t));
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] nb_bits_to_transmit %d (15 already allocated for header)\n", LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] nb_bits_to_transmit %d (15 already allocated for header)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
......
...@@ -1170,7 +1170,7 @@ void rlc_am_v9_3_0_test(void) ...@@ -1170,7 +1170,7 @@ void rlc_am_v9_3_0_test(void)
{ {
// initscr(); // initscr();
// cbreak(); // cbreak();
// keypad(stdscr, TRUE); // keypad(stdscr, true);
// under test // under test
pool_buffer_init(); pool_buffer_init();
set_comp_log(RLC, LOG_ERR, LOG_MED, 1); set_comp_log(RLC, LOG_ERR, LOG_MED, 1);
......
...@@ -111,7 +111,7 @@ rlc_am_check_timer_poll_retransmit( ...@@ -111,7 +111,7 @@ rlc_am_check_timer_poll_retransmit(
} }
rlc_pP->force_poll= TRUE; rlc_pP->force_poll = true;
//BugFix : new ms_time_out is computed when next poll is transmitter //BugFix : new ms_time_out is computed when next poll is transmitter
} }
} }
......
...@@ -31,13 +31,11 @@ ...@@ -31,13 +31,11 @@
#include "list.h" #include "list.h"
#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/MAC/mac_extern.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void rlc_tm_send_sdu(const protocol_ctxt_t* const ctxt_pP,
rlc_tm_send_sdu ( rlc_tm_entity_t * const rlc_pP,
const protocol_ctxt_t* const ctxt_pP, const bool error_indicationP,
rlc_tm_entity_t * const rlc_pP, uint8_t * const srcP,
const boolean_t error_indicationP, const sdu_size_t length_in_bitsP)
uint8_t * const srcP,
const sdu_size_t length_in_bitsP)
{ {
int length_in_bytes; int length_in_bytes;
#if DEBUG_RLC_TM_DISPLAY_ASCII_DATA #if DEBUG_RLC_TM_DISPLAY_ASCII_DATA
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
/*! \fn void rlc_tm_send_sdu ( /*! \fn void rlc_tm_send_sdu (
* const protocol_ctxt_t* const ctxt_pP, * const protocol_ctxt_t* const ctxt_pP,
* rlc_tm_entity_t * const rlc_pP, * rlc_tm_entity_t * const rlc_pP,
* const boolean_t error_indicationP, * const bool error_indicationP,
* uint8_t * const srcP, * uint8_t * const srcP,
* const sdu_size_t length_in_bitsP) * const sdu_size_t length_in_bitsP)
* \brief Send SDU if any reassemblied to upper layer. * \brief Send SDU if any reassemblied to upper layer.
...@@ -60,12 +60,11 @@ ...@@ -60,12 +60,11 @@
* \param[in] srcP SDU data pointer. * \param[in] srcP SDU data pointer.
* \param[in] length_in_bitsP Length of SDU in bits. * \param[in] length_in_bitsP Length of SDU in bits.
*/ */
void rlc_tm_send_sdu ( void rlc_tm_send_sdu(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlc_pP,
rlc_tm_entity_t * const rlc_pP, const bool error_indicationP,
const boolean_t error_indicationP, uint8_t * const srcP,
uint8_t * const srcP, const sdu_size_t length_in_bitsP);
const sdu_size_t length_in_bitsP);
/*! \fn void rlc_tm_no_segment (const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP) /*! \fn void rlc_tm_no_segment (const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP)
* \brief Schedule a SDU to be transmited by lower layers. * \brief Schedule a SDU to be transmited by lower layers.
......
...@@ -40,14 +40,13 @@ ...@@ -40,14 +40,13 @@
* \brief Structure containing a RLC TM instance protocol variables, allocation variables, buffers and other miscellaneous variables. * \brief Structure containing a RLC TM instance protocol variables, allocation variables, buffers and other miscellaneous variables.
*/ */
typedef struct rlc_tm_entity { typedef struct rlc_tm_entity {
boolean_t allocation; /*!< \brief Boolean for rlc_tm_entity_t struct allocation. */ bool allocation; /*!< \brief Boolean for rlc_tm_entity_t struct allocation. */
rlc_protocol_state_t protocol_state; /*!< \brief Protocol state, can be RLC_NULL_STATE, RLC_DATA_TRANSFER_READY_STATE, RLC_LOCAL_SUSPEND_STATE. */ rlc_protocol_state_t protocol_state; /*!< \brief Protocol state, can be RLC_NULL_STATE, RLC_DATA_TRANSFER_READY_STATE, RLC_LOCAL_SUSPEND_STATE. */
boolean_t is_uplink_downlink; /*!< \brief Is this instance is a transmitter, a receiver or both? */ bool is_uplink_downlink; /*!< \brief Is this instance is a transmitter, a receiver or both? */
boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */ bool is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
// for stats and trace purpose : // for stats and trace purpose :
logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */ logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */
rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */ rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */
//boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */
//----------------------------- //-----------------------------
// tranmission // tranmission
//----------------------------- //-----------------------------
......
...@@ -133,10 +133,9 @@ rlc_tm_cleanup ( ...@@ -133,10 +133,9 @@ rlc_tm_cleanup (
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_tm_configure( void rlc_tm_configure(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP,
rlc_tm_entity_t * const rlcP, const bool is_uplink_downlinkP)
const boolean_t is_uplink_downlinkP)
{ {
rlcP->is_uplink_downlink = is_uplink_downlinkP; rlcP->is_uplink_downlink = is_uplink_downlinkP;
rlc_tm_reset_state_variables (ctxt_pP, rlcP); rlc_tm_reset_state_variables (ctxt_pP, rlcP);
......
...@@ -78,27 +78,24 @@ void rlc_tm_init ( ...@@ -78,27 +78,24 @@ void rlc_tm_init (
* \brief Reset protocol variables and state variables to initial values. * \brief Reset protocol variables and state variables to initial values.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
*/ */
void rlc_tm_reset_state_variables ( void rlc_tm_reset_state_variables(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP);
rlc_tm_entity_t * const rlcP);
/*! \fn void rlc_tm_cleanup(rlc_tm_entity_t * const rlcP) /*! \fn void rlc_tm_cleanup(rlc_tm_entity_t * const rlcP)
* \brief Free all allocated memory (lists and buffers) previously allocated by this RLC TM instance. * \brief Free all allocated memory (lists and buffers) previously allocated by this RLC TM instance.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
*/ */
void rlc_tm_cleanup( void rlc_tm_cleanup(rlc_tm_entity_t * const rlcP);
rlc_tm_entity_t * const rlcP);
/*! \fn void rlc_tm_configure(const protocol_ctxt_t* const ctxt_pP,rlc_tm_entity_t * const rlcP, const boolean_t is_uplink_downlinkP) /*! \fn void rlc_tm_configure(const protocol_ctxt_t* const ctxt_pP,rlc_tm_entity_t * const rlcP, const bool is_uplink_downlinkP)
* \brief Configure RLC TM protocol parameters. * \brief Configure RLC TM protocol parameters.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] is_uplink_downlinkP Is this instance is TRANSMITTER_ONLY, * \param[in] is_uplink_downlinkP Is this instance is TRANSMITTER_ONLY,
RECEIVER_ONLY, or TRANSMITTER_AND_RECEIVER. RECEIVER_ONLY, or TRANSMITTER_AND_RECEIVER.
*/ */
void rlc_tm_configure( void rlc_tm_configure(const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP,
rlc_tm_entity_t * const rlcP, const bool is_uplink_downlinkP);
const boolean_t is_uplink_downlinkP);
/*! \fn void rlc_tm_set_debug_infos(const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP, const rb_id_t rb_idP, const srb_flag_t srb_flagP) /*! \fn void rlc_tm_set_debug_infos(const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP, const rb_id_t rb_idP, const srb_flag_t srb_flagP)
* \brief Set debug informations for a RLC TM protocol instance, these informations are only for trace purpose. * \brief Set debug informations for a RLC TM protocol instance, these informations are only for trace purpose.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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