Compare version number using MAKE_VERSION macro to provide better SW configuration:
1. Previous SW configuration for different RRC version relies on whether macro Rel10, Rel14 defined or not by checking #ifdef Rel14 or #if defined(Rel10) || defined(R14). Whenever there is a newer RRC version, e.g. Rel15, it will be very a tedious and error-prone job to add defined(Rel15) in every place. 2. Some RRC messages are defined in release 13 instead of release 14, NB-IoT feature is one of such example. Our code shall reflect this fact instead of using an afterward version number in software configuration. 3. Some RRC messages or some fields of certain RRC messages are added in the middle a release, e.g. SystemInformationBlockType1_v1310_IEs_t defined in RRC 13.1.0 and RRC 9.2.0 made some changes to SIB12 and SIB13 so we have sib12_v920 and sib13_v920 fields in SIB12 and SIB13's struct. We need a finer grain of control when using ASN1 from different RRC version. 4. S1AP also has this problem that it use UPDATE_RELEASE_9 and UPDATE_RELEASE_10 to differentiate between various S1AP version. This commit propose using MAKE_VERSION(x,y,z) to designate the version number and modify current conditional compilation accordingly. Note: 2018/04/16, Modified based on Cedric's comment.
This commit is contained in:
committed by
Cedric Roux
parent
184d51c6ea
commit
5c23af773a
+13
-13
@@ -151,7 +151,7 @@ void stop_eNB(int nb_inst);
|
||||
int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc);
|
||||
int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc);
|
||||
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||
#endif
|
||||
extern int codingw;
|
||||
@@ -213,7 +213,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
// if this is IF5 or 3GPP_eNB
|
||||
if (eNB && eNB->RU_list && eNB->RU_list[0] && eNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
|
||||
wakeup_prach_eNB(eNB,NULL,proc->frame_rx,proc->subframe_rx);
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
wakeup_prach_eNB_br(eNB,NULL,proc->frame_rx,proc->subframe_rx);
|
||||
#endif
|
||||
}
|
||||
@@ -705,7 +705,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
}
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
@@ -794,7 +794,7 @@ static void* eNB_thread_prach( void* param ) {
|
||||
|
||||
LOG_D(PHY,"Running eNB prach procedures\n");
|
||||
prach_procedures(eNB
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,0
|
||||
#endif
|
||||
);
|
||||
@@ -808,7 +808,7 @@ static void* eNB_thread_prach( void* param ) {
|
||||
return &eNB_thread_prach_status;
|
||||
}
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/*!
|
||||
* \brief The prach receive thread of eNB for BL/CE UEs.
|
||||
* \param param is a \ref eNB_proc_t structure which contains the info what to process.
|
||||
@@ -891,7 +891,7 @@ void init_eNB_proc(int inst) {
|
||||
eNB_proc_t *proc;
|
||||
eNB_rxtx_proc_t *proc_rxtx;
|
||||
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL;
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_attr_t *attr_prach_br=NULL;
|
||||
#endif
|
||||
|
||||
@@ -937,7 +937,7 @@ void init_eNB_proc(int inst) {
|
||||
pthread_attr_init( &proc->attr_asynch_rxtx);
|
||||
pthread_attr_init( &proc_rxtx[0].attr_rxtx);
|
||||
pthread_attr_init( &proc_rxtx[1].attr_rxtx);
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
proc->instance_cnt_prach_br = -1;
|
||||
proc->RU_mask_prach_br=0;
|
||||
pthread_mutex_init( &proc->mutex_prach_br, NULL);
|
||||
@@ -949,7 +949,7 @@ void init_eNB_proc(int inst) {
|
||||
attr0 = &proc_rxtx[0].attr_rxtx;
|
||||
attr1 = &proc_rxtx[1].attr_rxtx;
|
||||
attr_prach = &proc->attr_prach;
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
attr_prach_br = &proc->attr_prach_br;
|
||||
#endif
|
||||
|
||||
@@ -973,7 +973,7 @@ void init_eNB_proc(int inst) {
|
||||
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] );
|
||||
}
|
||||
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB );
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
||||
#endif
|
||||
char name[16];
|
||||
@@ -1057,7 +1057,7 @@ void kill_eNB_proc(int inst) {
|
||||
LOG_I(PHY, "Destroying prach mutex/cond\n");
|
||||
pthread_mutex_destroy( &proc->mutex_prach );
|
||||
pthread_cond_destroy( &proc->cond_prach );
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
proc->instance_cnt_prach_br = 0;
|
||||
pthread_cond_signal( &proc->cond_prach_br );
|
||||
pthread_join( proc->pthread_prach_br, (void**)&status );
|
||||
@@ -1207,7 +1207,7 @@ void init_eNB_afterRU(void) {
|
||||
LOG_I(PHY,"Overwriting eNB->prach_vars.rxsigF[0]:%p\n", eNB->prach_vars.rxsigF[0]);
|
||||
|
||||
eNB->prach_vars.rxsigF[0] = (int16_t**)malloc16(64*sizeof(int16_t*));
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
for (int ce_level=0;ce_level<4;ce_level++) {
|
||||
LOG_I(PHY,"Overwriting eNB->prach_vars_br.rxsigF.rxsigF[0]:%p\n", eNB->prach_vars_br.rxsigF[ce_level]);
|
||||
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t**)malloc16(64*sizeof(int16_t*));
|
||||
@@ -1230,7 +1230,7 @@ void init_eNB_afterRU(void) {
|
||||
for (i=0;i<eNB->RU_list[ru_id]->nb_rx;aa++,i++) {
|
||||
LOG_I(PHY,"Attaching RU %d antenna %d to eNB antenna %d\n",eNB->RU_list[ru_id]->idx,i,aa);
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[ru_id]->prach_rxsigF[i];
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
for (int ce_level=0;ce_level<4;ce_level++)
|
||||
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
|
||||
#endif
|
||||
@@ -1283,7 +1283,7 @@ void init_eNB_afterRU(void) {
|
||||
|
||||
RC.ru[ru_id]->wakeup_rxtx = wakeup_rxtx;
|
||||
RC.ru[ru_id]->wakeup_prach_eNB = wakeup_prach_eNB;
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
RC.ru[ru_id]->wakeup_prach_eNB_br = wakeup_prach_eNB_br;
|
||||
#endif
|
||||
RC.ru[ru_id]->eNB_top = eNB_top;
|
||||
|
||||
+15
-15
@@ -527,7 +527,7 @@ void fh_if4p5_south_asynch_in(RU_t *ru,int *frame,int *subframe) {
|
||||
}
|
||||
if (packet_type == IF4p5_PULFFT) symbol_mask &= (~(1<<symbol_number));
|
||||
else if (packet_type == IF4p5_PRACH) prach_rx &= (~0x1);
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
else if (packet_type == IF4p5_PRACH_BR_CE0) prach_rx &= (~0x2);
|
||||
else if (packet_type == IF4p5_PRACH_BR_CE1) prach_rx &= (~0x4);
|
||||
else if (packet_type == IF4p5_PRACH_BR_CE2) prach_rx &= (~0x8);
|
||||
@@ -1010,7 +1010,7 @@ static void* ru_thread_prach( void* param ) {
|
||||
if (ru->eNB_list[0]){
|
||||
prach_procedures(
|
||||
ru->eNB_list[0]
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,0
|
||||
#endif
|
||||
);
|
||||
@@ -1023,7 +1023,7 @@ static void* ru_thread_prach( void* param ) {
|
||||
NULL,
|
||||
proc->frame_prach,
|
||||
0
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,0
|
||||
#endif
|
||||
);
|
||||
@@ -1038,7 +1038,7 @@ static void* ru_thread_prach( void* param ) {
|
||||
return &ru_thread_prach_status;
|
||||
}
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
static void* ru_thread_prach_br( void* param ) {
|
||||
|
||||
static int ru_thread_prach_status;
|
||||
@@ -1237,7 +1237,7 @@ static inline int wakeup_prach_ru(RU_t *ru) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
static inline int wakeup_prach_ru_br(RU_t *ru) {
|
||||
|
||||
struct timespec wait;
|
||||
@@ -1627,7 +1627,7 @@ static void* ru_thread( void* param ) {
|
||||
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) {
|
||||
wakeup_prach_ru(ru);
|
||||
}
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
else if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>1)) {
|
||||
wakeup_prach_ru_br(ru);
|
||||
}
|
||||
@@ -1785,7 +1785,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
RU_proc_t *proc;
|
||||
pthread_attr_t *attr_FH=NULL,*attr_FH1=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_synch=NULL,*attr_emulateRF=NULL;
|
||||
//pthread_attr_t *attr_fep=NULL;
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_attr_t *attr_prach_br=NULL;
|
||||
#endif
|
||||
char name[100];
|
||||
@@ -1838,7 +1838,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
pthread_attr_init( &proc->attr_asynch_rxtx);
|
||||
pthread_attr_init( &proc->attr_fep);
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
proc->instance_cnt_prach_br = -1;
|
||||
pthread_mutex_init( &proc->mutex_prach_br, NULL);
|
||||
pthread_cond_init( &proc->cond_prach_br, NULL);
|
||||
@@ -1852,7 +1852,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
attr_synch = &proc->attr_synch;
|
||||
attr_asynch = &proc->attr_asynch_rxtx;
|
||||
attr_emulateRF = &proc->attr_emulateRF;
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
attr_prach_br = &proc->attr_prach_br;
|
||||
#endif
|
||||
#endif
|
||||
@@ -1866,7 +1866,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
|
||||
if (ru->function == NGFI_RRU_IF4p5) {
|
||||
pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru );
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, ru_thread_prach_br, (void*)ru );
|
||||
#endif
|
||||
if (ru->is_slave == 1) pthread_create( &proc->pthread_synch, attr_synch, ru_thread_synch, (void*)ru);
|
||||
@@ -1916,7 +1916,7 @@ void kill_RU_proc(int inst)
|
||||
pthread_cond_signal(&proc->cond_prach);
|
||||
pthread_mutex_unlock(&proc->mutex_prach);
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_mutex_lock(&proc->mutex_prach_br);
|
||||
proc->instance_cnt_prach_br = 0;
|
||||
pthread_cond_signal(&proc->cond_prach_br);
|
||||
@@ -1946,7 +1946,7 @@ void kill_RU_proc(int inst)
|
||||
if (ru->function == NGFI_RRU_IF4p5) {
|
||||
LOG_D(PHY, "Joining pthread_prach\n");
|
||||
pthread_join(proc->pthread_prach, NULL);
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
LOG_D(PHY, "Joining pthread_prach_br\n");
|
||||
pthread_join(proc->pthread_prach_br, NULL);
|
||||
#endif
|
||||
@@ -2010,7 +2010,7 @@ void kill_RU_proc(int inst)
|
||||
pthread_attr_destroy(&proc->attr_asynch_rxtx);
|
||||
pthread_attr_destroy(&proc->attr_fep);
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_mutex_destroy(&proc->mutex_prach_br);
|
||||
pthread_cond_destroy(&proc->cond_prach_br);
|
||||
pthread_attr_destroy(&proc->attr_prach_br);
|
||||
@@ -2106,7 +2106,7 @@ void configure_ru(int idx,
|
||||
LOG_I(PHY,"REMOTE_IF4p5: prach_FrequOffset %d, prach_ConfigIndex %d\n",
|
||||
config->prach_FreqOffset[0],config->prach_ConfigIndex[0]);
|
||||
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int i;
|
||||
for (i=0;i<4;i++) {
|
||||
config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i];
|
||||
@@ -2150,7 +2150,7 @@ void configure_rru(int idx,
|
||||
config->prach_FreqOffset[0],config->prach_ConfigIndex[0],ru->att_tx,ru->att_rx);
|
||||
ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = config->prach_FreqOffset[0];
|
||||
ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = config->prach_ConfigIndex[0];
|
||||
#ifdef Rel14
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
for (int i=0;i<4;i++) {
|
||||
ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i] = config->emtc_prach_CElevel_enable[0][i];
|
||||
ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i] = config->emtc_prach_FreqOffset[0][i];
|
||||
|
||||
@@ -163,7 +163,7 @@ extern channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
extern channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
|
||||
extern mapping small_scale_names[];
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
extern pdcp_mbms_t pdcp_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];
|
||||
extern pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];
|
||||
#endif
|
||||
@@ -1631,7 +1631,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
mbms_service_id_t service_id;
|
||||
mbms_session_id_t session_id;
|
||||
rb_id_t rb_id;
|
||||
@@ -1666,7 +1666,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
*/
|
||||
// old version
|
||||
/* // MBSM multicast traffic
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
if (frame >= 46) {// only generate when UE can receive MTCH (need to control this value)
|
||||
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
|
||||
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
|
||||
|
||||
Reference in New Issue
Block a user