Commit cdbf65f5 authored by Robert Schmidt's avatar Robert Schmidt

revise RAN API

- when changing values RC.rrc[i]->configuration should be changed too
- then, RRC_RECONFIGURATION_REQ will pass the changed conf down until PHY
- give warnings at functions that are not implemented

- rename functions
flexran_get_tdd_ack_nack_feedback() -> flexran_get_tdd_ack_nack_feedback_mode()
flexran_get_ue_pmi() -> flexran_get_ue_wpmi()
parent 6198a673
......@@ -21,237 +21,196 @@
/*! \file flexran_agent_ran_api.c
* \brief FlexRAN RAN API abstraction
* \author N. Nikaein, X. Foukas and S. SHARIAT BAGHERI
* \author N. Nikaein, X. Foukas, S. SHARIAT BAGHERI and R. Schmidt
* \date 2017
* \version 0.1
*/
#include "flexran_agent_ran_api.h"
/*
* generic info from RAN
*/
PHY_VARS_eNB *phy[NUM_MAX_ENB][MAX_NUM_CCs] = { NULL };
eNB_MAC_INST *mac[NUM_MAX_ENB] = { NULL };
eNB_RRC_INST *rrc[NUM_MAX_ENB] = { NULL };
UE_list_t *UE_list[NUM_MAX_ENB] = { NULL };
void * enb[NUM_MAX_ENB];
void * enb_ue[NUM_MAX_ENB];
void * enb_rrc[NUM_MAX_ENB];
Enb_properties_array_t* enb_properties;
void flexran_set_enb_vars(mid_t mod_id, ran_name_t ran){
switch (ran){
case RAN_LTE_OAI :
enb_properties = enb_config_get();
if(eNB_mac_inst == NULL){
enb[mod_id] = NULL;
enb_ue[mod_id] = NULL;
enb_rrc[mod_id] = NULL;
}else{
enb[mod_id] = (void *)&eNB_mac_inst[mod_id];
enb_ue[mod_id] = (void *)&eNB_mac_inst[mod_id].UE_list;
enb_rrc[mod_id] = (void *)&eNB_rrc_inst[mod_id];
}
break;
default :
goto error;
}
return;
error:
LOG_E(FLEXRAN_AGENT, "unknown RAN name %d\n", ran);
}
static int mac_xface_not_ready(void)
void flexran_set_RC_vars(mid_t mod_id, ran_name_t ran)
{
if (mac_xface == NULL) {
return 1;
int i;
if (ran == RAN_LTE_OAI) {
if (RC.eNB && mod_id < RC.nb_RU && RC.eNB[mod_id] && RC.nb_CC)
for (i = 0; i < *RC.nb_CC; i++)
phy[mod_id][i] = RC.eNB[mod_id][i];
if (RC.mac && mod_id < RC.nb_macrlc_inst && RC.mac[mod_id]) {
mac[mod_id] = RC.mac[mod_id];
UE_list[mod_id] = &RC.mac[mod_id]->UE_list;
}
if (RC.rrc && mod_id < RC.nb_macrlc_inst && RC.rrc[mod_id])
rrc[mod_id] = RC.rrc[mod_id];
}
else {
//printf("max_xface %p %d \n", mac_xface, mac_xface->active);
return 0;// !mac_xface->active;
LOG_E(FLEXRAN_AGENT, "unknown RAN name %d when setting RAN API variables\n", ran);
}
}
static int eNB_rrc_inst_not_ready(void)
uint32_t flexran_get_current_time_ms(mid_t mod_id, int subframe_flag)
{
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;
if (subframe_flag == 1){
return ((eNB_MAC_INST *)enb[mod_id])->frame*10 + ((eNB_MAC_INST *)enb[mod_id])->subframe;
}else {
return ((eNB_MAC_INST *)enb[mod_id])->frame*10;
}
if (!mac[mod_id]) return 0;
if (subframe_flag == 1)
return mac[mod_id]->frame*10 + mac[mod_id]->subframe;
else
return mac[mod_id]->frame*10;
}
unsigned int flexran_get_current_frame (mid_t mod_id) {
if (enb[mod_id] == NULL) return 0;
frame_t flexran_get_current_frame(mid_t mod_id)
{
if (!mac[mod_id]) return 0;
// #warning "SFN will not be in [0-1023] when oaisim is used"
return ((eNB_MAC_INST *)enb[mod_id])->frame;
return mac[mod_id]->frame;
}
unsigned int flexran_get_current_system_frame_num(mid_t mod_id) {
return (flexran_get_current_frame(mod_id) %1024);
frame_t flexran_get_current_system_frame_num(mid_t mod_id)
{
return flexran_get_current_frame(mod_id) % 1024;
}
unsigned int flexran_get_current_subframe (mid_t mod_id) {
if (enb[mod_id] == NULL) return 0;
return ((eNB_MAC_INST *)enb[mod_id])->subframe;
sub_frame_t flexran_get_current_subframe(mid_t mod_id)
{
if (!mac[mod_id]) return 0;
return mac[mod_id]->subframe;
}
uint16_t flexran_get_sfn_sf (mid_t mod_id) {
frame_t frame;
sub_frame_t subframe;
/* Why uint16_t, frame_t and sub_frame_t are defined as uint32_t? */
uint16_t flexran_get_sfn_sf(mid_t mod_id)
{
frame_t frame = flexran_get_current_system_frame_num(mod_id);
sub_frame_t subframe = flexran_get_current_subframe(mod_id);
uint16_t sfn_sf, frame_mask, sf_mask;
frame = (frame_t) flexran_get_current_system_frame_num(mod_id);
subframe = (sub_frame_t) flexran_get_current_subframe(mod_id);
frame_mask = ((1<<12) - 1);
sf_mask = ((1<<4) - 1);
frame_mask = (1 << 12) - 1;
sf_mask = (1 << 4) - 1;
sfn_sf = (subframe & sf_mask) | ((frame & frame_mask) << 4);
return sfn_sf;
}
uint16_t flexran_get_future_sfn_sf (mid_t mod_id, int ahead_of_time) {
frame_t frame;
sub_frame_t subframe;
uint16_t flexran_get_future_sfn_sf(mid_t mod_id, int ahead_of_time)
{
frame_t frame = flexran_get_current_system_frame_num(mod_id);
sub_frame_t subframe = flexran_get_current_subframe(mod_id);
uint16_t sfn_sf, frame_mask, sf_mask;
frame = (frame_t) flexran_get_current_system_frame_num(mod_id);
subframe = (sub_frame_t) flexran_get_current_subframe(mod_id);
int additional_frames;
subframe = ((subframe + ahead_of_time) % 10);
if (subframe < flexran_get_current_subframe(mod_id)) {
subframe = (subframe + ahead_of_time) % 10;
if (subframe < flexran_get_current_subframe(mod_id))
frame = (frame + 1) % 1024;
}
int additional_frames = ahead_of_time / 10;
additional_frames = ahead_of_time / 10;
frame = (frame + additional_frames) % 1024;
frame_mask = ((1<<12) - 1);
sf_mask = ((1<<4) - 1);
frame_mask = (1 << 12) - 1;
sf_mask = (1 << 4) - 1;
sfn_sf = (subframe & sf_mask) | ((frame & frame_mask) << 4);
return sfn_sf;
}
int flexran_get_num_ues (mid_t mod_id){
if (enb_ue[mod_id] == NULL) return 0;
return ((UE_list_t *)enb_ue[mod_id])->num_UEs;
int flexran_get_num_ues(mid_t mod_id)
{
if (!UE_list[mod_id]) return 0;
return UE_list[mod_id]->num_UEs;
}
int flexran_get_ue_crnti (mid_t mod_id, mid_t ue_id) {
return UE_RNTI(mod_id, ue_id);
rnti_t flexran_get_ue_crnti(mid_t mod_id, mid_t ue_id)
{
return UE_RNTI(mod_id, ue_id);
}
int flexran_get_ue_bsr (mid_t mod_id, mid_t ue_id, lcid_t lcid) {
if (enb_ue[mod_id] == NULL) return 0;
return ((UE_list_t *)enb_ue[mod_id])->UE_template[UE_PCCID(mod_id,ue_id)][ue_id].bsr_info[lcid];
uint8_t flexran_get_ue_bsr(mid_t mod_id, mid_t ue_id, lcid_t lcid)
{
if (!UE_list[mod_id]) return 0;
return UE_list[mod_id]->UE_template[UE_PCCID(mod_id, ue_id)][ue_id].bsr_info[lcid];
}
int flexran_get_ue_phr (mid_t mod_id, mid_t ue_id) {
if (enb_ue[mod_id] == NULL) return 0;
return ((UE_list_t *)enb_ue[mod_id])->UE_template[UE_PCCID(mod_id,ue_id)][ue_id].phr_info;
int8_t flexran_get_ue_phr(mid_t mod_id, mid_t ue_id)
{
if (!UE_list[mod_id]) return 0;
return UE_list[mod_id]->UE_template[UE_PCCID(mod_id, ue_id)][ue_id].phr_info;
}
int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id) {
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
if (mac_xface_not_ready()) return 0 ;
eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, 0, UE_RNTI(mod_id, ue_id));
return eNB_UE_stats->DL_cqi[0];
// return ((UE_list_t *)enb_ue[mod_id])->eNB_UE_stats[UE_PCCID(mod_id,ue_id)][ue_id].dl_cqi;
uint8_t flexran_get_ue_wcqi(mid_t mod_id, mid_t ue_id)
{
if (!phy[mod_id][0]) return 0;
return phy[mod_id][0]->UE_stats[ue_id].DL_cqi[0];
}
int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) {
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
rlc_buffer_occupancy_t flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id)
{
rnti_t rnti = flexran_get_ue_crnti(mod_id, ue_id);
frame_t frame = flexran_get_current_frame(mod_id);
sub_frame_t subframe = flexran_get_current_subframe(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id, frame, subframe, ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0);
return rlc_status.bytes_in_buffer;
}
int flexran_get_num_pdus_buffer(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) {
rlc_buffer_occupancy_t flexran_get_num_pdus_buffer(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id)
{
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
frame_t frame = flexran_get_current_frame(mod_id);
sub_frame_t subframe = flexran_get_current_subframe(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id, frame, subframe, ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0);
return rlc_status.pdus_in_buffer;
}
int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) {
frame_t flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id)
{
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
frame_t frame = flexran_get_current_frame(mod_id);
sub_frame_t subframe = flexran_get_current_subframe(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, subframe, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0);
return rlc_status.head_sdu_creation_time;
}
short flexran_get_TA(mid_t mod_id, mid_t ue_id, int CC_id) {
// UE_list_t *UE_list=&eNB_mac_inst[mod_id].UE_list;
int rnti;
rnti = flexran_get_ue_crnti(mod_id, ue_id);
if (mac_xface_not_ready()) return 0 ;
int32_t flexran_get_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti);
//ue_sched_ctl->ta_timer = 20; // wait 20 subframes before taking TA measurement from PHY
switch (flexran_get_N_RB_DL(mod_id, CC_id)) {
int32_t tau = phy[mod_id][cc_id]->UE_stats[ue_id].timing_advance_update;
switch (flexran_get_N_RB_DL(mod_id, cc_id)) {
case 6:
return eNB_UE_stats->timing_advance_update;
return tau;
case 15:
return eNB_UE_stats->timing_advance_update/2;
return tau / 2;
case 25:
return eNB_UE_stats->timing_advance_update/4;
return tau / 4;
case 50:
return eNB_UE_stats->timing_advance_update/8;
return tau / 8;
case 75:
return eNB_UE_stats->timing_advance_update/12;
return tau / 12;
case 100:
if (flexran_get_threequarter_fs(mod_id, CC_id) == 0) {
return eNB_UE_stats->timing_advance_update/16;
} else {
return eNB_UE_stats->timing_advance_update/12;
}
if (flexran_get_threequarter_fs(mod_id, cc_id) == 0)
return tau / 16;
else
return tau / 12;
default:
return 0;
}
}
int flexran_get_ue_pmi(mid_t mod_id){
/*Xenofon to check this*/
return 0;
uint8_t flexran_get_ue_wpmi(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
if (!UE_list[mod_id]) return 0;
return UE_list[mod_id]->UE_sched_ctrl[ue_id].periodic_wideband_pmi[cc_id];
}
void flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id) {
/* TODO needs to be revised */
void flexran_update_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
/*
UE_list_t *UE_list=&eNB_mac_inst[mod_id].UE_list;
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id];
......@@ -268,92 +227,79 @@ void flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id) {
ue_sched_ctl->ta_timer--;
ue_sched_ctl->ta_update = 0; // don't trigger a timing advance command
}
*/
#warning "Implement flexran_update_TA() in RAN API"
}
int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id,int CC_id) {
// UE_list_t *UE_list = &eNB_mac_inst[mod_id].UE_list;
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
if (mac_xface_not_ready()) return 0 ;
/* TODO needs to be revised, looks suspicious: why do we need UE stats? */
int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
#warning "Implement flexran_get_MAC_CE_bitmap_TA() in RAN API"
if (!phy[mod_id][cc_id]) return 0;
/* UE_stats can not be null, they are an array in RC
LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti);
if (eNB_UE_stats == NULL) {
return 0;
}
*/
if (flexran_get_TA(mod_id, ue_id, CC_id) != 0) {
if (flexran_get_TA(mod_id, ue_id, cc_id) != 0) {
return PROTOCOL__FLEX_CE_TYPE__FLPCET_TA;
} else {
return 0;
}
}
int flexran_get_active_CC(mid_t mod_id, mid_t ue_id) {
if (enb_ue[mod_id] == NULL) return 0;
return ((UE_list_t *)enb_ue[mod_id])->numactiveCCs[ue_id];
}
int flexran_get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id) {
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
if (mac_xface_not_ready()) return 0 ;
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti);
if (eNB_UE_stats == NULL) {
return 0;
}
return eNB_UE_stats[CC_id].rank;
int flexran_get_active_CC(mid_t mod_id, mid_t ue_id)
{
if (!UE_list[mod_id]) return 0;
return UE_list[mod_id]->numactiveCCs[ue_id];
}
int flexran_get_tpc(mid_t mod_id, mid_t ue_id) {
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
int32_t normalized_rx_power, target_rx_power;
int tpc = 1;
int pCCid = UE_PCCID(mod_id,ue_id);
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
if (mac_xface_not_ready()) return 0 ;
eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, pCCid, rnti);
target_rx_power = mac_xface->get_target_pusch_rx_power(mod_id,pCCid);
if (eNB_UE_stats == NULL) {
normalized_rx_power = target_rx_power;
} else if (eNB_UE_stats->UL_rssi != NULL) {
normalized_rx_power = eNB_UE_stats->UL_rssi[0];
} else {
normalized_rx_power = target_rx_power;
}
if (normalized_rx_power>(target_rx_power+1)) {
tpc = 0; //-1
} else if (normalized_rx_power<(target_rx_power-1)) {
tpc = 2; //+1
} else {
tpc = 1; //0
}
return tpc;
uint8_t flexran_get_current_RI(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->UE_stats[ue_id].rank;
}
int flexran_get_harq(const mid_t mod_id,
const uint8_t CC_id,
const mid_t ue_id,
const int frame,
const uint8_t subframe,
uint8_t *pid,
uint8_t *round,
const uint8_t harq_flag) { //flag_id_status = 0 then id, else status
/*TODO: Add int TB in function parameters to get the status of the second TB. This can be done to by editing in
* get_ue_active_harq_pid function in line 272 file: phy_procedures_lte_eNB.c to add
* DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/
int flexran_get_tpc(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
/* before: tested that UL_rssi != NULL and set parameter ([0]), but it is a
* static array -> target_rx_power is useless in old ifs?! */
int pCCid = UE_PCCID(mod_id,ue_id);
int32_t target_rx_power = phy[mod_id][pCCid]->frame_parms.ul_power_control_config_common.p0_NominalPUSCH;
int32_t normalized_rx_power = phy[mod_id][cc_id]->UE_stats[ue_id].UL_rssi[0];
int tpc;
if (normalized_rx_power > target_rx_power + 1)
tpc = 0; //-1
else if (normalized_rx_power < target_rx_power - 1)
tpc = 2; //+1
else
tpc = 1; //0
return tpc;
}
int flexran_get_harq(mid_t mod_id,
uint8_t cc_id,
mid_t ue_id,
frame_t frame,
sub_frame_t subframe,
uint8_t *pid,
uint8_t *round,
uint8_t harq_flag)
{
/* TODO: Add int TB in function parameters to get the status of the second
* TB. This can be done to by editing in get_ue_active_harq_pid function in
* line 272 file: phy_procedures_lte_eNB.c to add DLSCH_ptr =
* PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/
/* TODO IMPLEMENT */
/*
uint8_t harq_pid;
uint8_t harq_round;
......@@ -375,61 +321,39 @@ int flexran_get_harq(const mid_t mod_id,
*pid = harq_pid;
*round = harq_round;
*round = harq_round;*/
/* if (round > 0) { */
/* *status = 1; */
/* } else { */
/* *status = 0; */
/* } */
/* return 0; */
return *round;
/*return *round;*/
#warning "Implement flexran_get_harq() in RAN API"
return 0;
}
int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id) {
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
if (mac_xface_not_ready()) return 0 ;
eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti);
if (eNB_UE_stats == NULL) {
return -1;
}
// if(eNB_UE_stats->Po_PUCCH_update == 1) {
return eNB_UE_stats->Po_PUCCH_dBm;
//}
//else
// return -1;
int32_t flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->UE_stats[ue_id].Po_PUCCH_dBm;
}
int flexran_get_p0_nominal_pucch(mid_t mod_id, int CC_id) {
if (mac_xface_not_ready()) return 0 ;
int32_t pucch_rx_received = mac_xface->get_target_pucch_rx_power(mod_id, CC_id);
return pucch_rx_received;
int8_t flexran_get_p0_nominal_pucch(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.ul_power_control_config_common.p0_NominalPUCCH;
}
int flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, int CC_id) {
if (mac_xface_not_ready()) return 0 ;
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti);
return eNB_UE_stats->Po_PUCCH_update;
int32_t flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->UE_stats[ue_id].Po_PUCCH_update;
}
int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, int CC_id) {
if (mac_xface_not_ready()) return 0 ;
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti);
eNB_UE_stats->Po_PUCCH_update = 0;
int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
phy[mod_id][cc_id]->UE_stats[ue_id].Po_PUCCH_update = 0;
return 0;
}
......@@ -439,243 +363,206 @@ int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, int CC_id) {
* Get Messages for eNB Configuration Reply
* ************************************
*/
int flexran_get_threequarter_fs(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->threequarter_fs;
uint8_t flexran_get_threequarter_fs(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.threequarter_fs;
}
int flexran_get_hopping_offset(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->pusch_config_common.pusch_HoppingOffset;
uint8_t flexran_get_hopping_offset(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.pusch_config_common.pusch_HoppingOffset;
}
int flexran_get_hopping_mode(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->pusch_config_common.hoppingMode;
PUSCH_HOPPING_t flexran_get_hopping_mode(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.pusch_config_common.hoppingMode;
}
int flexran_get_n_SB(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->pusch_config_common.n_SB;
uint8_t flexran_get_n_SB(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.pusch_config_common.n_SB;
}
int flexran_get_enable64QAM(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->pusch_config_common.enable64QAM;
uint8_t flexran_get_enable64QAM(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.pusch_config_common.enable64QAM;
}
int flexran_get_phich_duration(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->phich_config_common.phich_duration;
PHICH_DURATION_t flexran_get_phich_duration(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.phich_config_common.phich_duration;
}
int flexran_get_phich_resource(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);
if(frame_parms->phich_config_common.phich_resource == oneSixth)
return 0;
else if(frame_parms->phich_config_common.phich_resource == half)
return 1;
else if(frame_parms->phich_config_common.phich_resource == one)
return 2;
else if(frame_parms->phich_config_common.phich_resource == two)
return 3;
return -1;
int flexran_get_phich_resource(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
/* TODO why don't we return phich_resource? */
switch (phy[mod_id][cc_id]->frame_parms.phich_config_common.phich_resource) {
case oneSixth:
return 0;
case half:
return 1;
case one:
return 2;
case two:
return 3;
default:
return -1;
}
}
int flexran_get_n1pucch_an(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->pucch_config_common.n1PUCCH_AN;
uint16_t flexran_get_n1pucch_an(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.pucch_config_common.n1PUCCH_AN;
}
int flexran_get_nRB_CQI(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->pucch_config_common.nRB_CQI;
uint8_t flexran_get_nRB_CQI(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.pucch_config_common.nRB_CQI;
}
int flexran_get_deltaPUCCH_Shift(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->pucch_config_common.deltaPUCCH_Shift;
uint8_t flexran_get_deltaPUCCH_Shift(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.pucch_config_common.deltaPUCCH_Shift;
}
int flexran_get_prach_ConfigIndex(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->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
uint8_t flexran_get_prach_ConfigIndex(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
}
int flexran_get_prach_FreqOffset(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->prach_config_common.prach_ConfigInfo.prach_FreqOffset;
uint8_t flexran_get_prach_FreqOffset(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset;
}
int flexran_get_maxHARQ_Msg3Tx(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->maxHARQ_Msg3Tx;
uint8_t flexran_get_maxHARQ_Msg3Tx(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.maxHARQ_Msg3Tx;
}
int flexran_get_ul_cyclic_prefix_length(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->Ncp_UL;
lte_prefix_type_t flexran_get_ul_cyclic_prefix_length(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.Ncp_UL;
}
int flexran_get_dl_cyclic_prefix_length(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->Ncp;
lte_prefix_type_t flexran_get_dl_cyclic_prefix_length(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.Ncp;
}
int flexran_get_cell_id(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->Nid_cell;
uint16_t flexran_get_cell_id(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.Nid_cell;
}
int flexran_get_srs_BandwidthConfig(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->soundingrs_ul_config_common.srs_BandwidthConfig;
uint8_t flexran_get_srs_BandwidthConfig(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.soundingrs_ul_config_common.srs_BandwidthConfig;
}
int flexran_get_srs_SubframeConfig(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->soundingrs_ul_config_common.srs_SubframeConfig;
uint8_t flexran_get_srs_SubframeConfig(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig;
}
int flexran_get_srs_MaxUpPts(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->soundingrs_ul_config_common.srs_MaxUpPts;
uint8_t flexran_get_srs_MaxUpPts(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.soundingrs_ul_config_common.srs_MaxUpPts;
}
int flexran_get_N_RB_DL(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->N_RB_DL;
uint8_t flexran_get_N_RB_DL(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.N_RB_DL;
}
int flexran_get_N_RB_UL(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->N_RB_UL;
uint8_t flexran_get_N_RB_UL(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.N_RB_UL;
}
int flexran_get_N_RBG(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->N_RBG;
uint8_t flexran_get_N_RBG(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.N_RBG;
}
int flexran_get_subframe_assignment(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->tdd_config;
uint8_t flexran_get_subframe_assignment(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.tdd_config;
}
int flexran_get_special_subframe_assignment(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->tdd_config_S;
uint8_t flexran_get_special_subframe_assignment(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.tdd_config_S;
}
int flexran_get_ra_ResponseWindowSize(mid_t mod_id, int CC_id) {
return enb_config_get()->properties[mod_id]->rach_raResponseWindowSize[CC_id];
long flexran_get_ra_ResponseWindowSize(mid_t mod_id, uint8_t cc_id)
{
if (!rrc[mod_id]) return 0;
return rrc[mod_id]->configuration.rach_raResponseWindowSize[cc_id];
}
int flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, int CC_id) {
return enb_config_get()->properties[mod_id]->rach_macContentionResolutionTimer[CC_id];
long flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, uint8_t cc_id)
{
if (!rrc[mod_id]) return 0;
return rrc[mod_id]->configuration.rach_macContentionResolutionTimer[cc_id];
}
int flexran_get_duplex_mode(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);
if (frame_parms == NULL) return -1;
if(frame_parms->frame_type == TDD)
return PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD;
else if (frame_parms->frame_type == FDD)
return PROTOCOL__FLEX_DUPLEX_MODE__FLDM_FDD;
return -1;
Protocol__FlexDuplexMode flexran_get_duplex_mode(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
switch (phy[mod_id][cc_id]->frame_parms.frame_type) {
case TDD:
return PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD;
case FDD:
return PROTOCOL__FLEX_DUPLEX_MODE__FLDM_FDD;
default:
return -1;
}
}
long flexran_get_si_window_length(mid_t mod_id, int CC_id) {
return ((eNB_RRC_INST *)enb_rrc[mod_id])->carrier[CC_id].sib1->si_WindowLength;
long flexran_get_si_window_length(mid_t mod_id, uint8_t cc_id)
{
if (!rrc[mod_id] || !rrc[mod_id]->carrier[cc_id].sib1) return 0;
return rrc[mod_id]->carrier[cc_id].sib1->si_WindowLength;
}
int flexran_get_sib1_length(mid_t mod_id, int CC_id) {
return ((eNB_RRC_INST *)enb_rrc[mod_id])->carrier[CC_id].sizeof_SIB1;
uint8_t flexran_get_sib1_length(mid_t mod_id, uint8_t cc_id)
{
if (!rrc[mod_id]) return 0;
return rrc[mod_id]->carrier[cc_id].sizeof_SIB1;
}
int flexran_get_num_pdcch_symb(mid_t mod_id, int CC_id) {
/* TODO: This should return the number of PDCCH symbols initially used by the cell CC_id */
return 0;
//(PHY_vars_UE_g[mod_id][CC_id]->lte_ue_pdcch_vars[mod_id]->num_pdcch_symbols);
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? */
if (!phy[mod_id][cc_id]) return 0;
return phy[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);
}
......@@ -687,98 +574,86 @@ int flexran_get_num_pdcch_symb(mid_t mod_id, int CC_id) {
*/
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);
TimeAlignmentTimer_t flexran_get_time_alignment_timer(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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) {
return ue_context_p->ue_context.mac_MainConfig->timeAlignmentTimerDedicated;
} else {
return -1;
}
} else {
return -1;
}
}
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(rrc[mod_id], rnti);
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) {
if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_setup) {
if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp0) {
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_GP1;
} else if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp1) {
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_GP2;
} else {
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF;
}
}
}
}
return -1;
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.mac_MainConfig) return -1;
return ue_context_p->ue_context.mac_MainConfig->timeAlignmentTimerDedicated;
}
Protocol__FlexMeasGapConfigPattern flexran_get_meas_gap_config(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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) {
if(ue_context_p->ue_context.measGapConfig != NULL){
if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_setup) {
if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp0) {
return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.choice.gp0;
} else if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp1) {
return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.choice.gp0;
}
}
}
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measGapConfig) return -1;
if (ue_context_p->ue_context.measGapConfig->present != MeasGapConfig_PR_setup) return -1;
switch (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present) {
case MeasGapConfig__setup__gapOffset_PR_gp0:
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_GP1;
case MeasGapConfig__setup__gapOffset_PR_gp1:
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_GP2;
default:
return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF;
}
return -1;
}
int flexran_get_rrc_status(const mid_t mod_id, const rnti_t rntiP){
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
long flexran_get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
if (eNB_rrc_inst_not_ready()) return -1;
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measGapConfig) return -1;
if (ue_context_p->ue_context.measGapConfig->present != MeasGapConfig_PR_setup) return -1;
switch (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present) {
case MeasGapConfig__setup__gapOffset_PR_gp0:
return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.choice.gp0;
case MeasGapConfig__setup__gapOffset_PR_gp1:
return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.choice.gp1;
default:
return -1;
}
}
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
/* 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)
{
if (!rrc[mod_id]) return 0;
if (ue_context_p != NULL) {
return(ue_context_p->ue_context.Status);
} else {
return RRC_INACTIVE;
}
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(rrc[mod_id], rnti);
if (!ue_context_p) return RRC_INACTIVE;
return ue_context_p->ue_context.Status;
}
int flexran_get_ue_aggregated_max_bitrate_dl (mid_t mod_id, mid_t ue_id) {
if (enb_ue[mod_id] == NULL) return 0;
return ((UE_list_t *)enb_ue[mod_id])->UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateDL;
uint64_t flexran_get_ue_aggregated_max_bitrate_dl(mid_t mod_id, mid_t ue_id)
{
if (!UE_list[mod_id]) return 0;
return UE_list[mod_id]->UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateDL;
}
int flexran_get_ue_aggregated_max_bitrate_ul (mid_t mod_id, mid_t ue_id) {
if (enb_ue[mod_id] == NULL) return 0;
return ((UE_list_t *)enb_ue[mod_id])->UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateUL;
uint64_t flexran_get_ue_aggregated_max_bitrate_ul(mid_t mod_id, mid_t ue_id)
{
if (!UE_list[mod_id]) return 0;
return UE_list[mod_id]->UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateUL;
}
int flexran_get_half_duplex(mid_t ue_id) {
int flexran_get_half_duplex(mid_t ue_id)
{
#warning "Implement flexran_get_half_duplex() in RAN API"
// TODO
//int halfduplex = 0;
//int bands_to_scan = ((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.count;
......@@ -790,14 +665,18 @@ int flexran_get_half_duplex(mid_t ue_id) {
return 0;
}
int flexran_get_intra_sf_hopping(mid_t ue_id) {
int flexran_get_intra_sf_hopping(mid_t ue_id)
{
#warning "Implement flexran_get_intra_sf_hopping() in RAN API"
//TODO:Get proper value
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
//return (0 & ( 1 << (31)));
return 0;
}
int flexran_get_type2_sb_1(mid_t ue_id) {
int flexran_get_type2_sb_1(mid_t ue_id)
{
#warning "Implement flexran_get_type2_sb_1() in RAN API"
//TODO:Get proper value
//uint8_t temp = 0;
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
......@@ -805,13 +684,17 @@ int flexran_get_type2_sb_1(mid_t ue_id) {
return 0;
}
int flexran_get_ue_category(mid_t ue_id) {
int flexran_get_ue_category(mid_t ue_id)
{
#warning "Implement flexran_get_ue_category() in RAN API"
//TODO:Get proper value
//return (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->ue_Category);
return 0;
}
int flexran_get_res_alloc_type1(mid_t ue_id) {
int flexran_get_res_alloc_type1(mid_t ue_id)
{
#warning "Implement flexran_get_res_alloc_type1() in RAN API"
//TODO:Get proper value
//uint8_t temp = 0;
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
......@@ -819,313 +702,291 @@ int flexran_get_res_alloc_type1(mid_t ue_id) {
return 0;
}
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) {
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
return ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode;
} else {
return -1;
}
} else {
return -1;
}
}
long flexran_get_ue_transmission_mode(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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);
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(rrc[mod_id], rnti);
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){
return ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->ttiBundling;
} else {
return -1;
}
}
else {
return -1;
}
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->antennaInfo) return -1;
return ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode;
}
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);
BOOLEAN_t flexran_get_tti_bundling(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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){
return *ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
}
}
return -1;
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.mac_MainConfig) return -1;
if (!ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config) return -1;
return ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->ttiBundling;
}
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);
long flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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){
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_ACK_Index;
} else {
return -1;
}
} else {
return -1;
}
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.mac_MainConfig) return -1;
if (!ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config) return -1;
return *(ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->maxHARQ_Tx);
}
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);
long flexran_get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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){
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
} else {
return -1;
}
} else {
return -1;
}
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated) return -1;
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_ACK_Index;
}
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);
long flexran_get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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){
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
} else {
return -1;
}
}
else {
return -1;
}
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated) return -1;
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
}
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);
long flexran_get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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(rrc[mod_id], rnti);
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){
if (ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic != NULL) {
return ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI;
}
}
}
return -1;
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated) return -1;
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
}
int flexran_get_ack_nack_simultaneous_trans(mid_t mod_id,mid_t ue_id) {
BOOLEAN_t flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
if (eNB_rrc_inst_not_ready()) return -1;
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(rrc[mod_id], rnti);
return (&eNB_rrc_inst[mod_id])->carrier[0].sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) return -1;
return ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI;
}
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);
BOOLEAN_t flexran_get_ack_nack_simultaneous_trans(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
{
if (!rrc[mod_id]) return -1;
if (!rrc[mod_id]->carrier[cc_id].sib2) return -1;
return rrc[mod_id]->carrier[cc_id].sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
}
if (eNB_rrc_inst_not_ready()) return -1;
CQI_ReportModeAperiodic_t flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id)
{
if (!rrc[mod_id]) 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){
return *ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
}
}
return -1;
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig) return -1;
return *ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
}
int flexran_get_tdd_ack_nack_feedback(mid_t mod_id, mid_t ue_id) {
// TODO: This needs fixing
return -1;
long flexran_get_tdd_ack_nack_feedback_mode(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
/* if (eNB_rrc_inst_not_ready()) return -1; */
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(rrc[mod_id], rnti);
/* struct rrc_eNB_ue_context_s* ue_context_p = NULL; */
/* uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); */
/* 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){ */
/* return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode; */
/* } else { */
/* return -1; */
/* } */
/* } else { */
/* return -1; */
/* } */
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode) return -1;
return *(ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode);
}
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);
long flexran_get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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){
return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->ackNackRepetition.choice.setup.repetitionFactor;
} else {
return -1;
}
} else {
return -1;
}
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated) return -1;
return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->ackNackRepetition.choice.setup.repetitionFactor;
}
int flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id) {
//TODO: need to double check
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
long flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
if (eNB_rrc_inst_not_ready()) return -1;
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(rrc[mod_id], rnti);
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){
if(ue_context_p->ue_context.mac_MainConfig->ext2 != NULL){
long val = (*(ue_context_p->ue_context.mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10));
if (val > 0) {
return 1;
}
}
}
}
return -1;
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.mac_MainConfig) return -1;
if (!ue_context_p->ue_context.mac_MainConfig->ext2) return -1;
if (!ue_context_p->ue_context.mac_MainConfig->ext2->mac_MainConfig_v1020) return -1;
return *(ue_context_p->ue_context.mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10);
}
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);
int flexran_get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
if (eNB_rrc_inst_not_ready()) return -1;
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(rrc[mod_id], rnti);
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){
if(ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup == AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_closedLoop) {
return 2;
} else if(ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup == AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_openLoop) {
return 1;
} else {
return 0;
}
} else {
return -1;
}
} else {
return -1;
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated) return -1;
if (!ue_context_p->ue_context.physicalConfigDedicated->antennaInfo) return -1;
switch (ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup) {
case AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_closedLoop:
return 2;
case AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_openLoop:
return 1;
default:
return 0;
}
}
int flexran_get_lcg(mid_t ue_id, mid_t lc_id) {
if (UE_mac_inst == NULL) {
return -1;
}
if(UE_mac_inst[ue_id].logicalChannelConfig[lc_id] != NULL) {
return *UE_mac_inst[ue_id].logicalChannelConfig[lc_id]->ul_SpecificParameters->logicalChannelGroup;
} else {
return -1;
}
long flexran_get_lcg(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);
}
int flexran_get_direction(mid_t ue_id, mid_t lc_id) {
/*TODO: fill with the value for the rest of LCID*/
if(lc_id == DCCH || lc_id == DCCH1) {
int flexran_get_direction(mid_t ue_id, mid_t lc_id)
{
/* TODO: fill with the value for the rest of LCID -> Robert: What does that
* mean? */
switch (lc_id) {
case DCCH:
case DCCH1:
return 2;
} else if(lc_id == DTCH) {
case DTCH:
return 1;
} else {
default:
return -1;
}
}
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;
uint8_t flexran_get_antenna_ports(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.nb_antenna_ports_eNB;
}
uint32_t flexran_agent_get_operating_dl_freq (mid_t mod_id, int cc_id) {
return (enb_properties->properties[mod_id]->downlink_frequency[cc_id] / 1000000);
/* 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[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.dl_CarrierFreq / 1000000;
}
uint32_t flexran_agent_get_operating_ul_freq (mid_t mod_id, int cc_id) {
return ((enb_properties->properties[mod_id]->downlink_frequency[cc_id] + enb_properties->properties[0]->uplink_frequency_offset[cc_id]) / 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[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.ul_CarrierFreq / 1000000;
}
int flexran_agent_get_operating_eutra_band (mid_t mod_id, int cc_id) {
return enb_properties->properties[mod_id]->eutra_band[cc_id];
}
int flexran_agent_get_operating_pdsch_refpower (mid_t mod_id, int cc_id) {
return enb_properties->properties[mod_id]->pdsch_referenceSignalPower[cc_id];
uint8_t flexran_agent_get_operating_eutra_band(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.eutra_band;
}
int flexran_agent_get_operating_pusch_p0 (mid_t mod_id, int cc_id) {
return enb_properties->properties[mod_id]->pusch_p0_Nominal[cc_id];
int8_t flexran_agent_get_operating_pdsch_refpower(mid_t mod_id, uint8_t cc_id)
{
if (!phy[mod_id][cc_id]) return 0;
return phy[mod_id][cc_id]->frame_parms.pdsch_config_common.referenceSignalPower;
}
void flexran_agent_set_operating_dl_freq (mid_t mod_id, int cc_id, uint32_t dl_freq_mhz) {
long flexran_agent_get_operating_pusch_p0(mid_t mod_id, uint8_t cc_id)
{
if (!rrc[mod_id]) return 0;
return rrc[mod_id]->configuration.pusch_p0_Nominal[cc_id];
}
enb_properties->properties[mod_id]->downlink_frequency[cc_id]=dl_freq_mhz * 1000000;
/*printf("[ENB_APP] mod id %d ccid %d dl freq %d/%d\n", mod_id, cc_id, dl_freq_mhz, enb_properties->properties[mod_id]->downlink_frequency[cc_id]); */
void flexran_agent_set_operating_dl_freq(mid_t mod_id, uint8_t cc_id, uint32_t dl_freq_mhz)
{
if (phy[mod_id][cc_id]) {
phy[mod_id][cc_id]->frame_parms.dl_CarrierFreq = dl_freq_mhz * 1000000;
}
if (rrc[mod_id]) {
rrc[mod_id]->configuration.downlink_frequency[cc_id] = dl_freq_mhz * 1000000;
}
}
void flexran_agent_set_operating_ul_freq (mid_t mod_id, int cc_id, int32_t ul_freq_offset_mhz) {
enb_properties->properties[mod_id]->uplink_frequency_offset[cc_id]=ul_freq_offset_mhz * 1000000;
void flexran_agent_set_operating_ul_freq(mid_t mod_id, uint8_t cc_id, int32_t ul_freq_mhz_offset)
{
if (phy[mod_id][cc_id]) {
uint32_t new_ul_freq_mhz = flexran_agent_get_operating_dl_freq(mod_id, cc_id) + ul_freq_mhz_offset;
phy[mod_id][cc_id]->frame_parms.ul_CarrierFreq = new_ul_freq_mhz * 1000000;
}
if (rrc[mod_id]) {
rrc[mod_id]->configuration.uplink_frequency_offset[cc_id] = ul_freq_mhz_offset;
}
}
//TBD
void flexran_agent_set_operating_eutra_band (mid_t mod_id, int cc_id) {
enb_properties->properties[mod_id]->eutra_band[cc_id]=7;
void flexran_agent_set_operating_eutra_band(mid_t mod_id, uint8_t cc_id, uint8_t eutra_band)
{
if (phy[mod_id][cc_id]) {
phy[mod_id][cc_id]->frame_parms.eutra_band = eutra_band;
}
if (rrc[mod_id]) {
rrc[mod_id]->configuration.eutra_band[cc_id] = eutra_band;
}
}
void flexran_agent_set_operating_bandwidth (mid_t mod_id, int cc_id, int bandwidth) {
enb_properties->properties[mod_id]->N_RB_DL[cc_id]=bandwidth;
/* Sets both DL/UL */
void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t N_RB)
{
if (phy[mod_id][cc_id]) {
phy[mod_id][cc_id]->frame_parms.N_RB_DL = N_RB;
phy[mod_id][cc_id]->frame_parms.N_RB_UL = N_RB;
}
if (rrc[mod_id]) {
rrc[mod_id]->configuration.N_RB_DL[cc_id] = N_RB;
}
}
void flexran_agent_set_operating_frame_type (mid_t mod_id, int cc_id, int frame_type) {
enb_properties->properties[mod_id]->frame_type[cc_id]=frame_type;
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, lte_frame_type_t frame_type)
{
if (phy[mod_id][cc_id]) {
phy[mod_id][cc_id]->frame_parms.frame_type = frame_type;
}
if (rrc[mod_id]) {
rrc[mod_id]->configuration.frame_type[cc_id] = frame_type;
}
}
/*********** PDCP *************/
......@@ -1234,192 +1095,99 @@ uint32_t flexran_get_pdcp_rx_oo(const mid_t mod_id, const mid_t ue_id, const lc
/******************** RRC *****************************/
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) {
return ue_context_p->ue_context.measResults->measId;
} else {
return -1;
}
} else {
return -1;
}
}
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) {
return RSRP_meas_mapping[ue_context_p->ue_context.measResults->measResultPCell.rsrpResult];
} else {
return -1;
}
} else {
return -1;
}
}
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);
MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
if (eNB_rrc_inst_not_ready()) return -1;
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(rrc[mod_id], rnti);
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) {
return RSRQ_meas_mapping[ue_context_p->ue_context.measResults->measResultPCell.rsrqResult];
} else {
return -1;
}
} else {
return -1;
}
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
return ue_context_p->ue_context.measResults->measId;
}
/*Number of neighbouring cells for specific UE*/
int flexran_get_rrc_num_ncell(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 0;
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){
if(ue_context_p->ue_context.measResults->measResultNeighCells != NULL) {
if (ue_context_p->ue_context.measResults->measResultNeighCells->present == MeasResults__measResultNeighCells_PR_measResultListEUTRA) {
return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.count;
}
else{
return 0;
}
} else {
return 0;
}
} else {
float flexran_get_rrc_pcell_rsrp(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
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(rrc[mod_id], rnti);
}
} else {
return 0;
}
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
return RSRP_meas_mapping[ue_context_p->ue_context.measResults->measResultPCell.rsrpResult];
}
int flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, mid_t ue_id, int cell_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->measResultNeighCells != NULL) {
if (ue_context_p->ue_context.measResults->measResultNeighCells->present == MeasResults__measResultNeighCells_PR_measResultListEUTRA) {
return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->physCellId;
float flexran_get_rrc_pcell_rsrq(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return -1;
}
else {
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(rrc[mod_id], rnti);
return -1;
}
} else {
return -1;
}
} else {
return -1;
}
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
return RSRQ_meas_mapping[ue_context_p->ue_context.measResults->measResultPCell.rsrqResult];
}
int flexran_get_rrc_neigh_rsrp(mid_t mod_id, mid_t ue_id, int cell_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) {
/*Number of neighbouring cells for specific UE*/
int flexran_get_rrc_num_ncell(mid_t mod_id, mid_t ue_id)
{
if (!rrc[mod_id]) return 0;
if(ue_context_p->ue_context.measResults->measResultNeighCells != NULL) {
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(rrc[mod_id], rnti);
if (ue_context_p->ue_context.measResults->measResultNeighCells->present == MeasResults__measResultNeighCells_PR_measResultListEUTRA) {
if (!ue_context_p) return 0;
if (!ue_context_p->ue_context.measResults) return 0;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return 0;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != MeasResults__measResultNeighCells_PR_measResultListEUTRA) return 0;
return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.count;
}
if (ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrpResult){
return RSRP_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrpResult)];
PhysCellId_t flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, mid_t ue_id, int cell_id)
{
if (!rrc[mod_id]) return -1;
}
else {
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(rrc[mod_id], rnti);
return 0;
}
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]) return -1;
return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->physCellId;
}
}
else {
float flexran_get_rrc_neigh_rsrp(mid_t mod_id, mid_t ue_id, int cell_id)
{
if (!rrc[mod_id]) return -1;
return -1;
}
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(rrc[mod_id], rnti);
}
else {
return -1;
}
}
else {
return -1;
}
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrpResult) return 0;
return RSRP_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrpResult)];
}
int flexran_get_rrc_neigh_rsrq(mid_t mod_id, mid_t ue_id, int cell_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
float flexran_get_rrc_neigh_rsrq(mid_t mod_id, mid_t ue_id, int cell_id)
{
if (!rrc[mod_id]) return -1;
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->measResultNeighCells != NULL) {
if (ue_context_p->ue_context.measResults->measResultNeighCells->present == MeasResults__measResultNeighCells_PR_measResultListEUTRA) {
if (ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrqResult){
return RSRQ_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrqResult)];
}
else {
return 0;
}
}
else {
return -1;
}
} else {
return -1;
}
} else {
return -1;
}
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(rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrqResult) return 0;
return RSRQ_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrqResult)];
}
......@@ -50,23 +50,23 @@
* get generic info from RAN
****************************/
void flexran_set_enb_vars(mid_t mod_id, ran_name_t ran);
void flexran_set_RC_vars(mid_t mod_id, ran_name_t ran);
int flexran_get_current_time_ms (mid_t mod_id, int subframe_flag);
uint32_t flexran_get_current_time_ms(mid_t mod_id, int subframe_flag);
/*Return the current frame number
*Could be using implementation specific numbering of frames
*/
unsigned int flexran_get_current_frame(mid_t mod_id);
frame_t flexran_get_current_frame(mid_t mod_id);
/*Return the current SFN (0-1023)*/
unsigned int flexran_get_current_system_frame_num(mid_t mod_id);
frame_t flexran_get_current_system_frame_num(mid_t mod_id);
unsigned int flexran_get_current_subframe(mid_t mod_id);
sub_frame_t flexran_get_current_subframe(mid_t mod_id);
/*Return the frame and subframe number in compact 16-bit format.
Bits 0-3 subframe, rest for frame. Required by FlexRAN protocol*/
uint16_t flexran_get_sfn_sf (mid_t mod_id);
uint16_t flexran_get_sfn_sf(mid_t mod_id);
/* Return a future frame and subframe number that is ahead_of_time
subframes later in compact 16-bit format. Bits 0-3 subframe,
......@@ -77,144 +77,151 @@ uint16_t flexran_get_future_sfn_sf(mid_t mod_id, int ahead_of_time);
int flexran_get_num_ues(mid_t mod_id);
/* Get the rnti of a UE with id ue_id */
int flexran_get_ue_crnti (mid_t mod_id, mid_t 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 */
int flexran_get_ue_bsr (mid_t mod_id, mid_t ue_id, lcid_t lcid);
uint8_t flexran_get_ue_bsr(mid_t mod_id, mid_t ue_id, lcid_t lcid);
/* Get power headroom of UE with id ue_id */
int flexran_get_ue_phr (mid_t mod_id, mid_t ue_id);
int8_t flexran_get_ue_phr(mid_t mod_id, mid_t ue_id);
/* Get the UE wideband CQI */
int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id);
uint8_t flexran_get_ue_wcqi(mid_t mod_id, mid_t ue_id);
/* Get the transmission queue size for a UE with a channel_id logical channel id */
int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
rlc_buffer_occupancy_t flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
/*Get number of pdus in RLC buffer*/
int flexran_get_num_pdus_buffer(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
rlc_buffer_occupancy_t flexran_get_num_pdus_buffer(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
/* Get the head of line delay for a UE with a channel_id logical channel id */
int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
frame_t flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
/* Check the status of the timing advance for a UE */
short flexran_get_TA(mid_t mod_id, mid_t ue_id, int CC_id);
int32_t flexran_get_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
/* Update the timing advance status (find out whether a timing advance command is required) */
void flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id);
/* Update the timing advance status(find out whether a timing advance command is required) */
/* currently broken
void flexran_update_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id); */
/* Return timing advance MAC control element for a designated cell and UE */
int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, int CC_id);
/* this function is broken */
int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
/* Get the number of active component carriers for a specific UE */
int flexran_get_active_CC(mid_t mod_id, mid_t ue_id);
/* Get the rank indicator for a designated cell and UE */
int flexran_get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id);
uint8_t flexran_get_current_RI(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
/* See TS 36.213, section 10.1 */
int flexran_get_n1pucch_an(mid_t mod_id, int CC_id);
uint16_t flexran_get_n1pucch_an(mid_t mod_id, uint8_t cc_id);
/* See TS 36.211, section 5.4 */
int flexran_get_nRB_CQI(mid_t mod_id, int CC_id);
uint8_t flexran_get_nRB_CQI(mid_t mod_id, uint8_t cc_id);
/* See TS 36.211, section 5.4 */
int flexran_get_deltaPUCCH_Shift(mid_t mod_id, int CC_id);
uint8_t flexran_get_deltaPUCCH_Shift(mid_t mod_id, uint8_t cc_id);
/* See TS 36.211, section 5.7.1 */
int flexran_get_prach_ConfigIndex(mid_t mod_id, int CC_id);
uint8_t flexran_get_prach_ConfigIndex(mid_t mod_id, uint8_t cc_id);
/* See TS 36.211, section 5.7.1 */
int flexran_get_prach_FreqOffset(mid_t mod_id, int CC_id);
uint8_t flexran_get_prach_FreqOffset(mid_t mod_id, uint8_t cc_id);
/* See TS 36.321 */
int flexran_get_maxHARQ_Msg3Tx(mid_t mod_id, int CC_id);
uint8_t flexran_get_maxHARQ_Msg3Tx(mid_t mod_id, uint8_t cc_id);
/* Get the length of the UL cyclic prefix */
int flexran_get_ul_cyclic_prefix_length(mid_t mod_id, int CC_id);
lte_prefix_type_t flexran_get_ul_cyclic_prefix_length(mid_t mod_id, uint8_t cc_id);
/* Get the length of the DL cyclic prefix */
int flexran_get_dl_cyclic_prefix_length(mid_t mod_id, int CC_id);
lte_prefix_type_t flexran_get_dl_cyclic_prefix_length(mid_t mod_id, uint8_t cc_id);
/* Get the physical cell id of a cell */
int flexran_get_cell_id(mid_t mod_id, int CC_id);
uint16_t flexran_get_cell_id(mid_t mod_id, uint8_t cc_id);
/* See TS 36.211, section 5.5.3.2 */
int flexran_get_srs_BandwidthConfig(mid_t mod_id, int CC_id);
uint8_t flexran_get_srs_BandwidthConfig(mid_t mod_id, uint8_t cc_id);
/* See TS 36.211, table 5.5.3.3-1 and 2 */
int flexran_get_srs_SubframeConfig(mid_t mod_id, int CC_id);
uint8_t flexran_get_srs_SubframeConfig(mid_t mod_id, uint8_t cc_id);
/* Boolean value. See TS 36.211,
section 5.5.3.2. TDD only */
int flexran_get_srs_MaxUpPts(mid_t mod_id, int CC_id);
uint8_t flexran_get_srs_MaxUpPts(mid_t mod_id, uint8_t cc_id);
/* Get number of DL resource blocks */
int flexran_get_N_RB_DL(mid_t mod_id, int CC_id);
uint8_t flexran_get_N_RB_DL(mid_t mod_id, uint8_t cc_id);
/* Get number of UL resource blocks */
int flexran_get_N_RB_UL(mid_t mod_id, int CC_id);
uint8_t flexran_get_N_RB_UL(mid_t mod_id, uint8_t cc_id);
/* Get number of resource block groups */
int flexran_get_N_RBG(mid_t mod_id, int CC_id);
uint8_t flexran_get_N_RBG(mid_t mod_id, uint8_t cc_id);
/* Get DL/UL subframe assignment. TDD only */
int flexran_get_subframe_assignment(mid_t mod_id, int CC_id);
uint8_t flexran_get_subframe_assignment(mid_t mod_id, uint8_t cc_id);
/* TDD only. See TS 36.211, table 4.2.1 */
int flexran_get_special_subframe_assignment(mid_t mod_id, int CC_id);
uint8_t flexran_get_special_subframe_assignment(mid_t mod_id, uint8_t cc_id);
/* Get the duration of the random access response window in subframes */
int flexran_get_ra_ResponseWindowSize(mid_t mod_id, int CC_id);
long flexran_get_ra_ResponseWindowSize(mid_t mod_id, uint8_t cc_id);
/* Get timer used for random access */
int flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, int CC_id);
long flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, uint8_t cc_id);
/* Get type of duplex mode (FDD/TDD) */
int flexran_get_duplex_mode(mid_t mod_id, int CC_id);
/* Get type of duplex mode(FDD/TDD) */
Protocol__FlexDuplexMode flexran_get_duplex_mode(mid_t mod_id, uint8_t cc_id);
/* Get the SI window length */
long flexran_get_si_window_length(mid_t mod_id, int CC_id);
long flexran_get_si_window_length(mid_t mod_id, uint8_t cc_id);
/* Get length of SystemInformationBlock1 */
uint8_t flexran_get_sib1_length(mid_t mod_id, uint8_t cc_id);
/* Get the number of PDCCH symbols configured for the cell */
int flexran_get_num_pdcch_symb(mid_t mod_id, int CC_id);
uint8_t flexran_get_num_pdcch_symb(mid_t mod_id, uint8_t cc_id);
int flexran_get_antenna_ports(mid_t mod_id, int CC_id);
uint8_t flexran_get_antenna_ports(mid_t mod_id, uint8_t cc_id);
/* See TS 36.213, sec 5.1.1.1 */
int flexran_get_tpc(mid_t mod_id, mid_t ue_id);
int flexran_get_tpc(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
int flexran_get_ue_pmi(mid_t mod_id);
uint8_t flexran_get_ue_wpmi(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
/* Get the first available HARQ process for a specific cell and UE during
a designated frame and subframe. Returns 0 for success. The id and the
status of the HARQ process are stored in id and status respectively */
int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id,
const int frame, const uint8_t subframe, unsigned char *id, unsigned char *round,const uint8_t harq_flag);
/* currently broken
int flexran_get_harq(mid_t mod_id, uint8_t cc_id, mid_t ue_id, frame_t frame,
sub_frame_t subframe, unsigned char *id, unsigned char *round,
uint8_t harq_flag); */
/* Uplink power control management*/
int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id);
int32_t flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
int flexran_get_p0_nominal_pucch(mid_t mod_id, int CC_id);
int8_t flexran_get_p0_nominal_pucch(mid_t mod_id, uint8_t cc_id);
int flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, int CC_id);
int32_t flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, int CC_id);
int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
int flexran_get_threequarter_fs(mid_t mod_id, int CC_id);
uint8_t flexran_get_threequarter_fs(mid_t mod_id, uint8_t cc_id);
int flexran_get_hopping_mode(mid_t mod_id, int CC_id);
PUSCH_HOPPING_t flexran_get_hopping_mode(mid_t mod_id, uint8_t cc_id);
int flexran_get_hopping_offset(mid_t mod_id, int CC_id);
uint8_t flexran_get_hopping_offset(mid_t mod_id, uint8_t cc_id);
int flexran_get_n_SB(mid_t mod_id, int CC_id);
uint8_t flexran_get_n_SB(mid_t mod_id, uint8_t cc_id);
int flexran_get_phich_resource(mid_t mod_id, int CC_id);
int flexran_get_phich_resource(mid_t mod_id, uint8_t cc_id);
int flexran_get_enable64QAM(mid_t mod_id, int CC_id);
uint8_t flexran_get_enable64QAM(mid_t mod_id, uint8_t cc_id);
int flexran_get_phich_duration(mid_t mod_id, int CC_id);
PHICH_DURATION_t flexran_get_phich_duration(mid_t mod_id, uint8_t cc_id);
/*
* ************************************
......@@ -225,119 +232,124 @@ int flexran_get_phich_duration(mid_t mod_id, int CC_id);
/* Get timer in subframes. Controls the synchronization
status of the UE, not the actual timing
advance procedure. See TS 36.321 */
int flexran_get_time_alignment_timer(mid_t mod_id, mid_t ue_id);
TimeAlignmentTimer_t flexran_get_time_alignment_timer(mid_t mod_id, mid_t ue_id);
/* Get measurement gap configuration. See TS 36.133 */
int flexran_get_meas_gap_config(mid_t mod_id, mid_t ue_id);
Protocol__FlexMeasGapConfigPattern flexran_get_meas_gap_config(mid_t mod_id, mid_t ue_id);
/* Get measurement gap configuration offset if applicable */
int flexran_get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id);
long flexran_get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id);
/* DL aggregated bit-rate of non-gbr bearer
per UE. See TS 36.413 */
int flexran_get_ue_aggregated_max_bitrate_dl (mid_t mod_id, mid_t ue_id);
uint64_t flexran_get_ue_aggregated_max_bitrate_dl(mid_t mod_id, mid_t ue_id);
/* UL aggregated bit-rate of non-gbr bearer
per UE. See TS 36.413 */
int flexran_get_ue_aggregated_max_bitrate_ul (mid_t mod_id, mid_t ue_id);
uint64_t flexran_get_ue_aggregated_max_bitrate_ul(mid_t mod_id, mid_t ue_id);
/* Only half-duplex support. FDD
operation. Boolean value */
int flexran_get_half_duplex(mid_t ue_id);
/* currently broken
int flexran_get_half_duplex(mid_t ue_id); */
/* Support of intra-subframe hopping.
Boolean value */
int flexran_get_intra_sf_hopping(mid_t ue_id);
/* currently broken
int flexran_get_intra_sf_hopping(mid_t ue_id); */
/* UE support for type 2 hopping with
n_sb>1 */
int flexran_get_type2_sb_1(mid_t ue_id);
/* currently broken
int flexran_get_type2_sb_1(mid_t ue_id); */
/* Get the UE category */
int flexran_get_ue_category(mid_t ue_id);
/* currently broken
int flexran_get_ue_category(mid_t ue_id); */
/* UE support for resource allocation
type 1 */
int flexran_get_res_alloc_type1(mid_t ue_id);
/* currently broken
int flexran_get_res_alloc_type1(mid_t ue_id); */
/* Get UE transmission mode */
int flexran_get_ue_transmission_mode(mid_t mod_id, mid_t ue_id);
long flexran_get_ue_transmission_mode(mid_t mod_id, mid_t ue_id);
/* Boolean value. See TS 36.321 */
int flexran_get_tti_bundling(mid_t mod_id, mid_t ue_id);
BOOLEAN_t flexran_get_tti_bundling(mid_t mod_id, mid_t ue_id);
/* The max HARQ retransmission for UL.
See TS 36.321 */
int flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id);
long flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id);
/* See TS 36.213 */
int flexran_get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id);
long flexran_get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id);
/* See TS 36.213 */
int flexran_get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id);
long flexran_get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id);
/* See TS 36.213 */
int flexran_get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id);
long flexran_get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id);
/* Boolean. See TS36.213, Section 10.1 */
int flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id);
BOOLEAN_t flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id);
/* Boolean. See TS 36.213, Section 8.2 */
int flexran_get_ack_nack_simultaneous_trans(mid_t mod_id,mid_t ue_id);
BOOLEAN_t flexran_get_ack_nack_simultaneous_trans(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
/* Get aperiodic CQI report mode */
int flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id);
CQI_ReportModeAperiodic_t flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id);
/* Get ACK/NACK feedback mode. TDD only */
int flexran_get_tdd_ack_nack_feedback(mid_t mod_id, mid_t ue_id);
long flexran_get_tdd_ack_nack_feedback_mode(mid_t mod_id, mid_t ue_id);
/* See TS36.213, section 10.1 */
int flexran_get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id);
long flexran_get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id);
/* Boolean. Extended buffer status report size */
int flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id);
long flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id);
/* Get number of UE transmission antennas */
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 */
int flexran_get_lcg(mid_t ue_id, mid_t lc_id);
long flexran_get_lcg(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);
/*Get downlink frequency*/
uint32_t flexran_agent_get_operating_dl_freq (mid_t mod_id, int cc_id);
uint32_t flexran_agent_get_operating_dl_freq(mid_t mod_id, uint8_t cc_id);
/*Get uplink frequency*/
uint32_t flexran_agent_get_operating_ul_freq (mid_t mod_id, int cc_id);
uint32_t flexran_agent_get_operating_ul_freq(mid_t mod_id, uint8_t cc_id);
/*Get eutra band*/
int flexran_agent_get_operating_eutra_band (mid_t mod_id, int cc_id);
uint8_t flexran_agent_get_operating_eutra_band(mid_t mod_id, uint8_t cc_id);
/*Get downlink ref signal power*/
int flexran_agent_get_operating_pdsch_refpower (mid_t mod_id, int cc_id);
int8_t flexran_agent_get_operating_pdsch_refpower(mid_t mod_id, uint8_t cc_id);
/*Get uplink power*/
int flexran_agent_get_operating_pusch_p0 (mid_t mod_id, int cc_id);
long flexran_agent_get_operating_pusch_p0(mid_t mod_id, uint8_t cc_id);
/*set the dl freq */
void flexran_agent_set_operating_dl_freq (mid_t mod_id, int cc_id, uint32_t dl_freq_mhz);
void flexran_agent_set_operating_dl_freq(mid_t mod_id, uint8_t cc_id, uint32_t dl_freq_mhz);
/* set the ul freq */
void flexran_agent_set_operating_ul_freq (mid_t mod_id, int cc_id, int32_t ul_freq_offset_mhz);
void flexran_agent_set_operating_ul_freq(mid_t mod_id, uint8_t cc_id, int32_t ul_freq_mhz_offset);
/*set the the band */
void flexran_agent_set_operating_eutra_band (mid_t mod_id, int cc_id);
void flexran_agent_set_operating_eutra_band(mid_t mod_id, uint8_t cc_id, uint8_t eutra_band);
/* set the bandwidth */
void flexran_agent_set_operating_bandwidth (mid_t mod_id, int cc_id, int bandwidth);
/* set the bandwidth (in RB) */
void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t N_RB);
/*set frame type*/
void flexran_agent_set_operating_frame_type (mid_t mod_id, int cc_id, int frame_type);
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, lte_frame_type_t frame_type);
/*RRC status flexRAN*/
int flexran_get_rrc_status(const mid_t mod_id, const rnti_t rntiP);
uint8_t flexran_get_rrc_status(const mid_t mod_id, const rnti_t rntiP);
/***************************** PDCP ***********************/
......@@ -399,28 +411,30 @@ uint32_t flexran_get_pdcp_rx_oo(const mid_t mod_id, const mid_t ue_id, const lc
/*********************RRC**********************/
/*Get primary cell measuremeant id flexRAN*/
int flexran_get_rrc_pcell_measid(mid_t mod_id, mid_t ue_id);
MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, mid_t ue_id);
/*Get primary cell RSRP measurement flexRAN*/
int flexran_get_rrc_pcell_rsrp(mid_t mod_id, mid_t ue_id);
float flexran_get_rrc_pcell_rsrp(mid_t mod_id, mid_t ue_id);
/*Get primary cell RSRQ measurement flexRAN*/
int flexran_get_rrc_pcell_rsrq(mid_t mod_id, mid_t ue_id);
float flexran_get_rrc_pcell_rsrq(mid_t mod_id, mid_t ue_id);
/* Get RRC neighbouring measurement */
int flexran_get_rrc_num_ncell(mid_t mod_id, mid_t ue_id);
/*Get physical cell id*/
int flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, mid_t ue_id, int cell_id);
PhysCellId_t flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, mid_t ue_id, int cell_id);
/*Get RSRP of neighbouring Cell*/
int flexran_get_rrc_neigh_rsrp(mid_t mod_id, mid_t ue_id, int cell_id);
float flexran_get_rrc_neigh_rsrp(mid_t mod_id, mid_t ue_id, int cell_id);
/*Get RSRQ of neighbouring Cell*/
int flexran_get_rrc_neigh_rsrq(mid_t mod_id, mid_t ue_id, int cell_id);
float flexran_get_rrc_neigh_rsrq(mid_t mod_id, mid_t ue_id, int cell_id);
/*Get MCC PLMN identity neighbouring Cell*/
int flexran_get_rrc_neigh_plmn_mcc(mid_t mod_id, mid_t ue_id, int cell_id);
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mcc(mid_t mod_id, mid_t ue_id, int cell_id); */
/*Get MNC PLMN identity neighbouring Cell*/
int flexran_get_rrc_neigh_plmn_mnc(mid_t mod_id, mid_t ue_id, int cell_id);
\ No newline at end of file
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mnc(mid_t mod_id, mid_t ue_id, int cell_id); */
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