Commit 8c0ebfad authored by Robert Schmidt's avatar Robert Schmidt

Add FlexRAN PLMN ID list and remove defunct cell_id

parent d9d6ce37
......@@ -647,8 +647,6 @@ int flexran_agent_register_rrc_xface(mid_t mod_id)
void flexran_agent_fill_rrc_cell_config(mid_t mod_id, uint8_t cc_id,
Protocol__FlexCellConfig *conf) {
conf->cell_id = cc_id;
conf->has_cell_id = 1;
if (!conf->si_config) {
conf->si_config = malloc(sizeof(Protocol__FlexSiConfig));
......@@ -696,6 +694,24 @@ void flexran_agent_fill_rrc_cell_config(mid_t mod_id, uint8_t cc_id,
conf->ul_pusch_power = flexran_agent_get_operating_pusch_p0 (mod_id, cc_id);
conf->has_ul_pusch_power = 1;
conf->n_plmn_id = flexran_get_rrc_num_plmn_ids(mod_id);
conf->plmn_id = calloc(conf->n_plmn_id, sizeof(Protocol__FlexPlmn *));
if (conf->plmn_id) {
for (int i = 0; i < conf->n_plmn_id; i++) {
conf->plmn_id[i] = malloc(sizeof(Protocol__FlexPlmn));
if (!conf->plmn_id[i]) continue;
protocol__flex_plmn__init(conf->plmn_id[i]);
conf->plmn_id[i]->mcc = flexran_get_rrc_mcc(mod_id, i);
conf->plmn_id[i]->has_mcc = 1;
conf->plmn_id[i]->mnc = flexran_get_rrc_mnc(mod_id, i);
conf->plmn_id[i]->has_mnc = 1;
conf->plmn_id[i]->mnc_length = flexran_get_rrc_mnc_digit_length(mod_id, i);
conf->plmn_id[i]->has_mnc_length = 1;
}
} else {
conf->n_plmn_id = 0;
}
}
int flexran_agent_unregister_rrc_xface(mid_t mod_id)
......
......@@ -262,3 +262,9 @@ enum flex_ue_state_change_type {
FLUESC_DEACTIVATED = 2;
FLUESC_MOVED = 3;
}
message flex_plmn {
optional uint32 mcc = 1;
optional uint32 mnc = 2;
optional uint32 mnc_length = 3;
}
......@@ -5,7 +5,6 @@ import "config_common.proto";
message flex_cell_config {
optional uint32 phy_cell_id = 1; // The PCI of this cell
optional uint32 cell_id = 2; // The PLMN cell id of this cell
optional uint32 pusch_hopping_offset = 3; // PUSCH resources in RBs for hopping
optional uint32 hopping_mode = 4; // One of the FLHM_* enum values
optional uint32 n_sb = 5; // The number of subbands
......@@ -43,6 +42,7 @@ message flex_cell_config {
optional uint32 eutra_band= 37; // operating band
optional int32 dl_pdsch_power = 38; // operating downlink power
optional int32 ul_pusch_power = 39; // operating uplink power
repeated flex_plmn plmn_id = 40; // The PLMN cell id of this cell
optional flex_slice_config slice_config = 42;
}
......
......@@ -542,7 +542,7 @@ int apply_parameter_modification(void *parameter, yaml_parser_t *parser) {
void initiate_soft_restart(module_id_t mod_id, Protocol__FlexCellConfig *c)
{
uint8_t cc_id = c->has_cell_id ? c->cell_id : 0;
const uint8_t cc_id = 0;
if (c->has_eutra_band) {
flexran_agent_set_operating_eutra_band(mod_id, cc_id, c->eutra_band);
LOG_I(ENB_APP, "Setting eutra_band to %d\n", c->eutra_band);
......
......@@ -1503,6 +1503,30 @@ float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id)
return RSRQ_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrqResult)];
}
uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id)
{
if (!rrc_is_present(mod_id)) return 0;
return RC.rrc[mod_id]->configuration.num_plmn;
}
uint16_t flexran_get_rrc_mcc(mid_t mod_id, uint8_t index)
{
if (!rrc_is_present(mod_id)) return 0;
return RC.rrc[mod_id]->configuration.mcc[index];
}
uint16_t flexran_get_rrc_mnc(mid_t mod_id, uint8_t index)
{
if (!rrc_is_present(mod_id)) return 0;
return RC.rrc[mod_id]->configuration.mnc[index];
}
uint8_t flexran_get_rrc_mnc_digit_length(mid_t mod_id, uint8_t index)
{
if (!rrc_is_present(mod_id)) return 0;
return RC.rrc[mod_id]->configuration.mnc_digit_length[index];
}
/**************************** SLICING ****************************/
int flexran_get_ue_dl_slice_id(mid_t mod_id, mid_t ue_id)
{
......
......@@ -527,6 +527,18 @@ int flexran_get_rrc_neigh_plmn_mcc(mid_t mod_id, rnti_t rnti, int cell_id); */
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mnc(mid_t mod_id, mid_t ue_id, int cell_id); */
/* Get number of PLMNs that is broadcasted in SIB1 */
uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id);
/* Get index'th MCC broadcasted in SIB1 */
uint16_t flexran_get_rrc_mcc(mid_t mod_id, uint8_t index);
/* Get index'th MNC broadcasted in SIB1 */
uint16_t flexran_get_rrc_mnc(mid_t mod_id, uint8_t index);
/* Get index'th MNC's digit length broadcasted in SIB1 */
uint8_t flexran_get_rrc_mnc_digit_length(mid_t mod_id, uint8_t index);
/************************** Slice configuration **************************/
/* Get the DL slice ID for a UE */
......
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