Commit 6e6a462d authored by Robert Schmidt's avatar Robert Schmidt

check whether RRC instance is present in RAN API

parent 49ea4748
......@@ -65,17 +65,27 @@ void flexran_set_enb_vars(mid_t mod_id, ran_name_t ran){
error:
LOG_E(FLEXRAN_AGENT, "unknown RAN name %d\n", ran);
}
static int mac_xface_not_ready(void);
static int mac_xface_not_ready(void){
if (mac_xface == NULL)
static int mac_xface_not_ready(void)
{
if (mac_xface == NULL) {
return 1;
}
else {
//printf("max_xface %p %d \n", mac_xface, mac_xface->active);
return 0;// !mac_xface->active;
}
}
static int eNB_rrc_inst_not_ready(void)
{
if (NULL == eNB_rrc_inst) {
return 1;
}
else {
return 0;
}
}
int flexran_get_current_time_ms (mid_t mod_id, int subframe_flag){
if (enb[mod_id] == NULL) return 0;
......@@ -682,6 +692,8 @@ int flexran_get_time_alignment_timer(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.mac_MainConfig != NULL) {
......@@ -698,6 +710,8 @@ int flexran_get_meas_gap_config(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measGapConfig != NULL) {
......@@ -720,6 +734,8 @@ int flexran_get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
......@@ -741,6 +757,8 @@ int flexran_get_rrc_status(const mid_t mod_id, const rnti_t rntiP){
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if (ue_context_p != NULL) {
......@@ -806,6 +824,8 @@ int flexran_get_ue_transmission_mode(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
......@@ -823,6 +843,8 @@ int flexran_get_tti_bundling(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.mac_MainConfig != NULL){
......@@ -840,6 +862,8 @@ int flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.mac_MainConfig != NULL){
......@@ -853,6 +877,8 @@ int flexran_get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
......@@ -869,6 +895,8 @@ int flexran_get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
......@@ -885,6 +913,8 @@ int flexran_get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
......@@ -902,6 +932,8 @@ int flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
......@@ -914,6 +946,9 @@ int flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id) {
}
int flexran_get_ack_nack_simultaneous_trans(mid_t mod_id,mid_t ue_id) {
if (eNB_rrc_inst_not_ready()) return -1;
return (&eNB_rrc_inst[mod_id])->carrier[0].sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
}
......@@ -921,6 +956,8 @@ int flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
......@@ -935,6 +972,8 @@ int flexran_get_tdd_ack_nack_feedback(mid_t mod_id, mid_t ue_id) {
// TODO: This needs fixing
return -1;
/* if (eNB_rrc_inst_not_ready()) return -1; */
/* struct rrc_eNB_ue_context_s* ue_context_p = NULL; */
/* uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); */
......@@ -955,6 +994,8 @@ int flexran_get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
......@@ -972,6 +1013,8 @@ int flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.mac_MainConfig != NULL){
......@@ -990,6 +1033,8 @@ int flexran_get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
......@@ -1035,6 +1080,8 @@ int flexran_get_antenna_ports(mid_t mod_id, int CC_id){
LTE_DL_FRAME_PARMS *frame_parms;
if (mac_xface_not_ready()) return 0;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return (frame_parms == NULL)? 0:frame_parms->nb_antenna_ports_eNB;
......@@ -1172,6 +1219,8 @@ int flexran_get_rrc_pcell_measid(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measResults != NULL) {
......@@ -1187,6 +1236,8 @@ int flexran_get_rrc_pcell_rsrp(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measResults != NULL) {
......@@ -1202,6 +1253,8 @@ int flexran_get_rrc_pcell_rsrq(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measResults != NULL) {
......@@ -1218,6 +1271,8 @@ void* flexran_get_rrc_ncell_measresult_eutra(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
if (eNB_rrc_inst_not_ready()) return -1;
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measResults != NULL) {
......
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