Commit cf0a5ca9 authored by Robert Schmidt's avatar Robert Schmidt

fix RAN API due to merge + repair functions

parent a78aaa45
......@@ -83,7 +83,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
goto error;
for (j = 0; j < ue_report[i]->n_bsr; j++) {
// NN: we need to know the cc_id here, consider the first one
elem[j] = flexran_get_ue_bsr (enb_id, i, j);
elem[j] = flexran_get_ue_bsr_ul_buffer_info (enb_id, i, j);
}
ue_report[i]->bsr = elem;
......
......@@ -489,10 +489,10 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl
lc_config[j]->has_lcid = 1;
lc_config[j]->lcid = j+1;
int lcg = flexran_get_lcg(i, j+1);
int lcg = flexran_get_lcg(mod_id, i, j+1);
if (lcg >= 0 && lcg <= 3) {
lc_config[j]->has_lcg = 1;
lc_config[j]->lcg = flexran_get_lcg(i,j+1);
lc_config[j]->lcg = flexran_get_lcg(mod_id, i,j+1);
}
lc_config[j]->has_direction = 1;
......
......@@ -117,10 +117,10 @@ rnti_t flexran_get_ue_crnti(mid_t mod_id, mid_t ue_id)
return UE_RNTI(mod_id, ue_id);
}
uint8_t flexran_get_ue_bsr(mid_t mod_id, mid_t ue_id, lcid_t lcid)
int flexran_get_ue_bsr_ul_buffer_info(mid_t mod_id, mid_t ue_id, lcid_t lcid)
{
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].bsr_info[lcid];
if (!mac_is_present(mod_id)) return -1;
return RC.mac[mod_id]->UE_list.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].ul_buffer_info[lcid];
}
int8_t flexran_get_ue_phr(mid_t mod_id, mid_t ue_id)
......@@ -390,7 +390,6 @@ PHICH_DURATION_t flexran_get_phich_duration(mid_t mod_id, uint8_t cc_id)
int flexran_get_phich_resource(mid_t mod_id, uint8_t cc_id)
{
if (!phy_is_present(mod_id, cc_id)) return 0;
/* TODO why don't we return phich_resource? */
switch (RC.eNB[mod_id][cc_id]->frame_parms.phich_config_common.phich_resource) {
case oneSixth:
return 0;
......@@ -544,12 +543,10 @@ uint8_t flexran_get_sib1_length(mid_t mod_id, uint8_t cc_id)
return RC.rrc[mod_id]->carrier[cc_id].sizeof_SIB1;
}
uint8_t flexran_get_num_pdcch_symb(mid_t mod_id, uint8_t cc_id) {
/* TODO: This should return the number of PDCCH symbols initially used by the
* cell cc_id -> is the correction right? */
uint8_t flexran_get_num_pdcch_symb(mid_t mod_id, uint8_t cc_id)
{
if (!phy_is_present(mod_id, cc_id)) return 0;
return RC.eNB[mod_id][cc_id]->pdcch_vars[0].num_pdcch_symbols;
//(PHY_vars_UE_g[mod_id][cc_id]->lte_ue_pdcch_vars[mod_id]->num_pdcch_symbols);
}
......@@ -614,12 +611,11 @@ long flexran_get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id)
}
}
/* TODO is there a reason we take the RNTI and not the UE ID? */
/* TODO return type is unsigned, so we cannot return -1 in case of error! */
uint8_t flexran_get_rrc_status(mid_t mod_id, rnti_t rnti)
uint8_t flexran_get_rrc_status(mid_t mod_id, mid_t ue_id)
{
if (!rrc_is_present(mod_id)) return 0;
rnti_t rnti = flexran_get_ue_crnti(mod_id, ue_id);
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return RRC_INACTIVE;
......@@ -893,14 +889,10 @@ int flexran_get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id)
}
}
/* TODO Navid: Get the same for eNB */
long flexran_get_lcg(mid_t ue_id, mid_t lc_id)
long flexran_get_lcg(mid_t mod_id, mid_t ue_id, mid_t lc_id)
{
if (!UE_mac_inst) return -1;
if (!UE_mac_inst[ue_id].logicalChannelConfig[lc_id]) return -1;
if (!UE_mac_inst[ue_id].logicalChannelConfig[lc_id]->ul_SpecificParameters) return -1;
if (!UE_mac_inst[ue_id].logicalChannelConfig[lc_id]->ul_SpecificParameters->logicalChannelGroup) return -1;
return *(UE_mac_inst[ue_id].logicalChannelConfig[lc_id]->ul_SpecificParameters->logicalChannelGroup);
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].lcgidmap[lc_id];
}
/* TODO Navid: needs to be revised */
......@@ -923,14 +915,12 @@ uint8_t flexran_get_antenna_ports(mid_t mod_id, uint8_t cc_id)
return RC.eNB[mod_id][cc_id]->frame_parms.nb_antenna_ports_eNB;
}
/* TODO better give real value (without division)? */
uint32_t flexran_agent_get_operating_dl_freq(mid_t mod_id, uint8_t cc_id)
{
if (!phy_is_present(mod_id, cc_id)) return 0;
return RC.eNB[mod_id][cc_id]->frame_parms.dl_CarrierFreq / 1000000;
}
/* TODO better give real value (without division)? */
uint32_t flexran_agent_get_operating_ul_freq(mid_t mod_id, uint8_t cc_id)
{
if (!phy_is_present(mod_id, cc_id)) return 0;
......
......@@ -77,9 +77,9 @@ int flexran_get_num_ues(mid_t mod_id);
/* Get the rnti of a UE with id ue_id */
rnti_t flexran_get_ue_crnti(mid_t mod_id, mid_t ue_id);
/* Get the RLC buffer status report of a ue for a designated
logical channel id */
uint8_t flexran_get_ue_bsr(mid_t mod_id, mid_t ue_id, lcid_t lcid);
/* Get the RLC buffer status report in bytes of a ue for a designated
* logical channel id */
int flexran_get_ue_bsr_ul_buffer_info(mid_t mod_id, mid_t ue_id, lcid_t lcid);
/* Get power headroom of UE with id ue_id */
int8_t flexran_get_ue_phr(mid_t mod_id, mid_t ue_id);
......@@ -302,7 +302,7 @@ long flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id);
int flexran_get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id);
/* Get logical channel group of a channel with id lc_id */
long flexran_get_lcg(mid_t ue_id, mid_t lc_id);
long flexran_get_lcg(mid_t mod_id, mid_t ue_id, mid_t lc_id);
/* Get direction of logical channel with id lc_id */
int flexran_get_direction(mid_t ue_id, mid_t lc_id);
......@@ -338,7 +338,7 @@ void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, lte_frame_type_t frame_type);
/*RRC status flexRAN*/
uint8_t flexran_get_rrc_status(const mid_t mod_id, const rnti_t rntiP);
uint8_t flexran_get_rrc_status(mid_t mod_id, mid_t ue_id);
/***************************** PDCP ***********************/
......
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