ASN1 - MCG Config

Fill the right DRBs for Master Cell Group Config and drop the bearer_id_start, nb_bearers_to_setup
parent 9354a452
......@@ -472,8 +472,13 @@ void free_nr_noS1_bearer_config(NR_RadioBearerConfig_t **rbconfig,
*rlc_rbconfig = NULL;
}
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb, uint8_t configure_srb, uint8_t bearer_id_start, uint8_t nb_bearers_to_setup, long *priority) {
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
NR_CellGroupConfig_t *ue_context_mastercellGroup,
int use_rlc_um_for_drb,
uint8_t configure_srb,
NR_DRB_ToAddModList_t *drb_configList,
long *priority)
{
cellGroupConfig->cellGroupId = 0;
cellGroupConfig->rlc_BearerToReleaseList = NULL;
cellGroupConfig->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
......@@ -487,11 +492,14 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
}
// DRB Configuration
for (int i = bearer_id_start; i < bearer_id_start + nb_bearers_to_setup; i++ ){
const NR_RLC_Config_PR rlc_conf = use_rlc_um_for_drb ? NR_RLC_Config_PR_um_Bi_Directional : NR_RLC_Config_PR_am;
NR_RLC_BearerConfig_t *rlc_BearerConfig = get_DRB_RLC_BearerConfig(3 + i, i, rlc_conf, priority[i - 1]);
asn1cSeqAdd(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig);
asn1cSeqAdd(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig);
if (drb_configList != NULL) {
for (int i = 0; i < drb_configList->list.count; ++i) {
const NR_RLC_Config_PR rlc_conf = use_rlc_um_for_drb ? NR_RLC_Config_PR_um_Bi_Directional : NR_RLC_Config_PR_am;
int rb_id = drb_configList->list.array[i]->drb_Identity;
NR_RLC_BearerConfig_t *rlc_BearerConfig = get_DRB_RLC_BearerConfig(3 + rb_id, rb_id, rlc_conf, priority[rb_id - 1]);
asn1cSeqAdd(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig);
asn1cSeqAdd(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig);
}
}
}
......
......@@ -79,14 +79,24 @@ void fill_nr_noS1_bearer_config(NR_RadioBearerConfig_t **rbconfig,
NR_RLC_BearerConfig_t **rlc_rbconfig);
void free_nr_noS1_bearer_config(NR_RadioBearerConfig_t **rbconfig,
NR_RLC_BearerConfig_t **rlc_rbconfig);
/**
* @brief Function to fill out the master cell group config to be used in RRCReconfiguration.
* If it is misused the ue_context_mastercellGroup, might lead to ASN1 encoding failure,
* because in ue_context_mastercellGroup the rlc_BearerConfigs are added but never removed,
* so the maximum number of rlc_BearerConfigs is exceeded.
*
* @param cellGroupConfig The MCG that will be used in do_RRCReconfiguration.
* @param ue_context_mastercellGroup The MCG that is stored in the ue context.
* @param[in] use_rlc_um_for_drb Set to 1, if RLC uses 'Unacknowledged Mode' for the DRB.
* @param[in] configure_srb Set to 1, if SRB2 needs be added to MCG.
* @param[in] drb_configList The Data Radio Bearer list, to be added.
* @param[in] priority The priorities set for the Data Radio Bearers.
*/
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
NR_CellGroupConfig_t *ue_context_mastercellGroup,
int use_rlc_um_for_drb,
uint8_t configure_srb,
uint8_t bearer_id_start,
uint8_t nb_bearers_to_setup,
NR_DRB_ToAddModList_t *drb_configList,
long *priority);
int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
......
......@@ -707,9 +707,13 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
if(cell_groupConfig_from_DU == NULL){
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
// FIXME: fill_mastercellGroupConfig() won't fill the right priorities or
// bearer IDs for the DRBs
fill_mastercellGroupConfig(cellGroupConfig, ue_p->masterCellGroup, rrc->um_on_default_drb, (drb_id_to_setup_start < 2) ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
// FIXME: fill_mastercellGroupConfig() won't fill the right priorities
fill_mastercellGroupConfig(cellGroupConfig,
ue_p->masterCellGroup,
rrc->um_on_default_drb,
(drb_id_to_setup_start < 2) ? 1 : 0,
DRB_configList,
drb_priority);
}
else{
LOG_I(NR_RRC, "Master cell group originating from the DU \n");
......@@ -1487,7 +1491,6 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
cellGroupConfig->physicalCellGroupConfig = ue_p->masterCellGroup->physicalCellGroupConfig;
uint8_t drb_id_to_setup_start = ue_p->DRB_configList ? ue_p->DRB_configList->list.array[0]->drb_Identity : 1;
uint8_t nb_drb_to_setup = ue_p->DRB_configList ? ue_p->DRB_configList->list.count : ue_p->nb_of_pdusessions;
/* TODO: hardcoded to 13 for the time being, to be changed? */
long drb_priority[NGAP_MAX_DRBS_PER_UE] = {13};
......@@ -1495,8 +1498,7 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
ue_p->masterCellGroup,
rrc->um_on_default_drb,
(drb_id_to_setup_start < 2) ? 1 : 0,
drb_id_to_setup_start,
nb_drb_to_setup,
ue_p->DRB_configList2[new_xid],
drb_priority);
for (i = 0; i < cellGroupConfig->rlc_BearerToAddModList->list.count; i++) {
......@@ -2481,7 +2483,12 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, in
if(req->srbs_to_be_setup_length>0 || req->drbs_to_be_setup_length>0){
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
fill_mastercellGroupConfig(cellGroupConfig, UE->masterCellGroup, rrc->um_on_default_drb, drb_id_to_setup_start < 2 ? 1 : 0, drb_id_to_setup_start, req->drbs_to_be_setup_length, drb_priority);
fill_mastercellGroupConfig(cellGroupConfig,
UE->masterCellGroup,
rrc->um_on_default_drb,
drb_id_to_setup_start < 2 ? 1 : 0,
DRB_configList,
drb_priority);
apply_macrlc_config(rrc, ue_context_p, &ctxt);
}
if(req->ReconfigComplOutcome == RRCreconf_failure){
......
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