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

Merge remote-tracking branch 'origin/multiple_pdu_MR' into integration_2022_wk22

parents 5ea828e1 cd4bc84b
...@@ -331,7 +331,7 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -331,7 +331,7 @@ int nr_process_mac_pdu( instance_t module_idP,
0); 0);
break; break;
case UL_SCH_LCID_DTCH: case UL_SCH_LCID_DTCH ... (UL_SCH_LCID_DTCH + 28):
// check if LCID is valid at current time. // check if LCID is valid at current time.
if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len))
return 0; return 0;
......
...@@ -977,11 +977,6 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s, ...@@ -977,11 +977,6 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s,
exit(1); exit(1);
} }
if (drb_id != 1) {
LOG_E(PDCP, "%s:%d:%s: fatal, bad drb id %d\n",
__FILE__, __LINE__, __FUNCTION__, drb_id);
exit(1);
}
nr_pdcp_manager_lock(nr_pdcp_ue_manager); nr_pdcp_manager_lock(nr_pdcp_ue_manager);
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti); ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
......
...@@ -123,7 +123,7 @@ void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config ...@@ -123,7 +123,7 @@ void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config
rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms15; rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms15;
break; break;
default: default:
LOG_E (RLC, "Error in %s: RLC config type %d is not handled\n", __FUNCTION__, rlc_config_pr); AssertFatal(0, "RLC config type %d not handled\n", rlc_config_pr);
break; break;
} }
......
...@@ -2161,25 +2161,19 @@ void fill_initial_SpCellConfig(int uid, ...@@ -2161,25 +2161,19 @@ void fill_initial_SpCellConfig(int uid,
} }
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup,int use_rlc_um_for_drb) { NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(long channelId,
long priority,
cellGroupConfig->cellGroupId = 0; e_NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration bucketSizeDuration)
cellGroupConfig->rlc_BearerToReleaseList = NULL; {
cellGroupConfig->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
// RLC Bearer Config
// TS38.331 9.2.1 Default SRB configurations
NR_RLC_BearerConfig_t *rlc_BearerConfig = NULL; NR_RLC_BearerConfig_t *rlc_BearerConfig = NULL;
NR_RLC_Config_t *rlc_Config = NULL;
NR_LogicalChannelConfig_t *logicalChannelConfig = NULL;
long *logicalChannelGroup = NULL;
rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t)); rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t));
rlc_BearerConfig->logicalChannelIdentity = 2; rlc_BearerConfig->logicalChannelIdentity = channelId;
rlc_BearerConfig->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig->servedRadioBearer)); rlc_BearerConfig->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig->servedRadioBearer));
rlc_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity; rlc_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity;
rlc_BearerConfig->servedRadioBearer->choice.srb_Identity = 2; rlc_BearerConfig->servedRadioBearer->choice.srb_Identity = channelId;
rlc_BearerConfig->reestablishRLC = NULL; rlc_BearerConfig->reestablishRLC = NULL;
rlc_Config = calloc(1, sizeof(NR_RLC_Config_t));
NR_RLC_Config_t *rlc_Config = calloc(1, sizeof(NR_RLC_Config_t));
rlc_Config->present = NR_RLC_Config_PR_am; rlc_Config->present = NR_RLC_Config_PR_am;
rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am)); rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am));
rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t)); rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t));
...@@ -2193,12 +2187,14 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ...@@ -2193,12 +2187,14 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_infinity; rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_infinity;
rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t8; rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t8;
rlc_BearerConfig->rlc_Config = rlc_Config; rlc_BearerConfig->rlc_Config = rlc_Config;
logicalChannelConfig = calloc(1, sizeof(NR_LogicalChannelConfig_t));
NR_LogicalChannelConfig_t *logicalChannelConfig = calloc(1, sizeof(NR_LogicalChannelConfig_t));
logicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig->ul_SpecificParameters)); logicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig->ul_SpecificParameters));
logicalChannelConfig->ul_SpecificParameters->priority = 3; logicalChannelConfig->ul_SpecificParameters->priority = priority;
logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity; logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration = NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms5; logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration = bucketSizeDuration;
logicalChannelGroup = CALLOC(1, sizeof(long));
long *logicalChannelGroup = CALLOC(1, sizeof(long));
*logicalChannelGroup = 0; *logicalChannelGroup = 0;
logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup; logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup;
logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID)); logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID));
...@@ -2206,42 +2202,62 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ...@@ -2206,42 +2202,62 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = 0; logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = 0;
logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0; logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0;
rlc_BearerConfig->mac_LogicalChannelConfig = logicalChannelConfig; rlc_BearerConfig->mac_LogicalChannelConfig = logicalChannelConfig;
return rlc_BearerConfig;
}
NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR_RLC_Config_PR rlc_conf, long priority)
{
NR_RLC_BearerConfig_t *rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t));
rlc_BearerConfig->logicalChannelIdentity = lcChannelId;
rlc_BearerConfig->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig->servedRadioBearer));
rlc_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity;
rlc_BearerConfig->servedRadioBearer->choice.drb_Identity = drbId;
rlc_BearerConfig->reestablishRLC = NULL;
NR_RLC_Config_t *rlc_Config = calloc(1, sizeof(NR_RLC_Config_t));
nr_drb_config(rlc_Config, rlc_conf);
rlc_BearerConfig->rlc_Config = rlc_Config;
NR_LogicalChannelConfig_t *logicalChannelConfig = calloc(1, sizeof(NR_LogicalChannelConfig_t));
logicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig->ul_SpecificParameters));
logicalChannelConfig->ul_SpecificParameters->priority = priority;
logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8;
logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration = NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms100;
long *logicalChannelGroup = CALLOC(1, sizeof(long));
*logicalChannelGroup = 1;
logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup;
logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID));
*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = 0;
logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = 0;
logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0;
rlc_BearerConfig->mac_LogicalChannelConfig = logicalChannelConfig;
return rlc_BearerConfig;
}
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 ) {
cellGroupConfig->cellGroupId = 0;
cellGroupConfig->rlc_BearerToReleaseList = NULL;
cellGroupConfig->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
// RLC Bearer Config
// TS38.331 9.2.1 Default SRB configurations
if (configure_srb){
NR_RLC_BearerConfig_t *rlc_BearerConfig = get_SRB_RLC_BearerConfig(2, 3, NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms5);
ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig);
ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig); ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig);
}
// DRB Configuration // DRB Configuration
NR_RLC_BearerConfig_t *rlc_BearerConfig_drb = NULL; for (int i = bearer_id_start; i < bearer_id_start + nb_bearers_to_setup; i++ ){
NR_RLC_Config_t *rlc_Config_drb = NULL; 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_LogicalChannelConfig_t *logicalChannelConfig_drb = NULL; NR_RLC_BearerConfig_t *rlc_BearerConfig = get_DRB_RLC_BearerConfig(3 + i, i, rlc_conf, priority[i-bearer_id_start]);
long *logicalChannelGroup_drb = NULL; ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig);
rlc_BearerConfig_drb = calloc(1, sizeof(NR_RLC_BearerConfig_t)); ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig);
rlc_BearerConfig_drb->logicalChannelIdentity = 4; }
rlc_BearerConfig_drb->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig_drb->servedRadioBearer));
rlc_BearerConfig_drb->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity;
rlc_BearerConfig_drb->servedRadioBearer->choice.drb_Identity = 1;
rlc_BearerConfig_drb->reestablishRLC = NULL;
rlc_Config_drb = calloc(1, sizeof(NR_RLC_Config_t));
if (use_rlc_um_for_drb) nr_drb_config(rlc_Config_drb, NR_RLC_Config_PR_um_Bi_Directional);
else nr_drb_config(rlc_Config_drb, NR_RLC_Config_PR_am);
rlc_BearerConfig_drb->rlc_Config = rlc_Config_drb;
logicalChannelConfig_drb = calloc(1, sizeof(NR_LogicalChannelConfig_t));
logicalChannelConfig_drb->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig_drb->ul_SpecificParameters));
logicalChannelConfig_drb->ul_SpecificParameters->priority = 13;
logicalChannelConfig_drb->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8;
logicalChannelConfig_drb->ul_SpecificParameters->bucketSizeDuration = NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms100;
logicalChannelGroup_drb = CALLOC(1, sizeof(long));
*logicalChannelGroup_drb = 1;
logicalChannelConfig_drb->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup_drb;
logicalChannelConfig_drb->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig_drb->ul_SpecificParameters->schedulingRequestID));
*logicalChannelConfig_drb->ul_SpecificParameters->schedulingRequestID = 0;
logicalChannelConfig_drb->ul_SpecificParameters->logicalChannelSR_Mask = 0;
logicalChannelConfig_drb->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0;
rlc_BearerConfig_drb->mac_LogicalChannelConfig = logicalChannelConfig_drb;
ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig_drb);
ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb);
} }
...@@ -2277,50 +2293,15 @@ void fill_initial_cellGroupConfig(int uid, ...@@ -2277,50 +2293,15 @@ void fill_initial_cellGroupConfig(int uid,
NR_ServingCellConfig_t *servingcellconfigdedicated, NR_ServingCellConfig_t *servingcellconfigdedicated,
const gNB_RrcConfigurationReq *configuration) const gNB_RrcConfigurationReq *configuration)
{ {
NR_RLC_BearerConfig_t *rlc_BearerConfig = NULL;
NR_RLC_Config_t *rlc_Config = NULL;
NR_LogicalChannelConfig_t *logicalChannelConfig = NULL;
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig = NULL; NR_MAC_CellGroupConfig_t *mac_CellGroupConfig = NULL;
NR_PhysicalCellGroupConfig_t *physicalCellGroupConfig = NULL; NR_PhysicalCellGroupConfig_t *physicalCellGroupConfig = NULL;
long *logicalChannelGroup = NULL;
cellGroupConfig->cellGroupId = 0; cellGroupConfig->cellGroupId = 0;
/* Rlc Bearer Config */ /* Rlc Bearer Config */
/* TS38.331 9.2.1 Default SRB configurations */ /* TS38.331 9.2.1 Default SRB configurations */
cellGroupConfig->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList)); cellGroupConfig->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t)); NR_RLC_BearerConfig_t *rlc_BearerConfig = get_SRB_RLC_BearerConfig(1, 1, NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms1000);
rlc_BearerConfig->logicalChannelIdentity = 1;
rlc_BearerConfig->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig->servedRadioBearer));
rlc_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity;
rlc_BearerConfig->servedRadioBearer->choice.srb_Identity = 1;
rlc_BearerConfig->reestablishRLC = NULL;
rlc_Config = calloc(1, sizeof(NR_RLC_Config_t));
rlc_Config->present = NR_RLC_Config_PR_am;
rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am));
rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t));
*(rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength) = NR_SN_FieldLengthAM_size12;
rlc_Config->choice.am->dl_AM_RLC.t_Reassembly = NR_T_Reassembly_ms35;
rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms0;
rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t));
*(rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength) = NR_SN_FieldLengthAM_size12;
rlc_Config->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms45;
rlc_Config->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_infinity;
rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_infinity;
rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t8;
rlc_BearerConfig->rlc_Config = rlc_Config;
logicalChannelConfig = calloc(1, sizeof(NR_LogicalChannelConfig_t));
logicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig->ul_SpecificParameters));
logicalChannelConfig->ul_SpecificParameters->priority = 1;
logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
logicalChannelGroup = CALLOC(1, sizeof(long));
*logicalChannelGroup = 0;
logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup;
logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID));
*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = 0;
logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = 0;
logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0;
rlc_BearerConfig->mac_LogicalChannelConfig = logicalChannelConfig;
ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig);
cellGroupConfig->rlc_BearerToReleaseList = NULL; cellGroupConfig->rlc_BearerToReleaseList = NULL;
......
...@@ -117,7 +117,13 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, ...@@ -117,7 +117,13 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
NR_UE_NR_Capability_t *uecap, NR_UE_NR_Capability_t *uecap,
const gNB_RrcConfigurationReq *configuration); const gNB_RrcConfigurationReq *configuration);
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb); 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);
int16_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, int16_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t *const buffer, uint8_t *const buffer,
......
...@@ -845,6 +845,9 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -845,6 +845,9 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
int qos_flow_index = 0; int qos_flow_index = 0;
int pdu_sessions_done = 0; int pdu_sessions_done = 0;
int i; int i;
uint8_t drb_id_to_setup_start = 1;
uint8_t nb_drb_to_setup = 0;
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
NR_CellGroupConfig_t *cellGroupConfig; NR_CellGroupConfig_t *cellGroupConfig;
uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id); uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id);
...@@ -887,6 +890,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -887,6 +890,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
DRB_config = CALLOC(1, sizeof(*DRB_config)); DRB_config = CALLOC(1, sizeof(*DRB_config));
DRB_config->drb_Identity = i+1; DRB_config->drb_Identity = i+1;
if (drb_id_to_setup_start == 1) drb_id_to_setup_start = DRB_config->drb_Identity;
nb_drb_to_setup++;
DRB_config->cnAssociation = CALLOC(1, sizeof(*DRB_config->cnAssociation)); DRB_config->cnAssociation = CALLOC(1, sizeof(*DRB_config->cnAssociation));
DRB_config->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config; DRB_config->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config;
// sdap_Config // sdap_Config
...@@ -1000,8 +1005,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -1000,8 +1005,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
memset(buffer, 0, sizeof(buffer)); memset(buffer, 0, sizeof(buffer));
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
fill_mastercellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.masterCellGroup,
rrc->um_on_default_drb); fill_mastercellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.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);
size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer), size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer),
xid, xid,
*SRB_configList2, *SRB_configList2,
...@@ -3245,10 +3250,9 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha ...@@ -3245,10 +3250,9 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(message_p); f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(message_p);
uint32_t incoming_teid = 0; uint32_t incoming_teid = 0;
uint8_t drb_id_to_setup_start = 0;
NR_CellGroupConfig_t *cellGroupConfig; uint8_t nb_drb_to_setup = 0;
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
fill_mastercellGroupConfig(cellGroupConfig, ue_context_p->ue_context.masterCellGroup,rrc->um_on_default_drb);
/* Configure SRB2 */ /* Configure SRB2 */
NR_SRB_ToAddMod_t *SRB2_config = NULL; NR_SRB_ToAddMod_t *SRB2_config = NULL;
...@@ -3277,6 +3281,7 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha ...@@ -3277,6 +3281,7 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
ue_context_p->ue_context.DRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.DRB_configList)); ue_context_p->ue_context.DRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.DRB_configList));
} }
DRB_configList = ue_context_p->ue_context.DRB_configList; DRB_configList = ue_context_p->ue_context.DRB_configList;
nb_drb_to_setup = req->drbs_to_be_setup_length;
for (int i=0; i<req->drbs_to_be_setup_length; i++){ for (int i=0; i<req->drbs_to_be_setup_length; i++){
DRB_config = CALLOC(1, sizeof(*DRB_config)); DRB_config = CALLOC(1, sizeof(*DRB_config));
DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id; DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id;
...@@ -3286,6 +3291,7 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha ...@@ -3286,6 +3291,7 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address)); memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address));
addr.length=sizeof(drb_p.up_ul_tnl[0].tl_address)*8; addr.length=sizeof(drb_p.up_ul_tnl[0].tl_address)*8;
extern instance_t DUuniqInstance; extern instance_t DUuniqInstance;
if (!drb_id_to_setup_start) drb_id_to_setup_start = drb_p.drb_id;
incoming_teid=newGtpuCreateTunnel(DUuniqInstance, incoming_teid=newGtpuCreateTunnel(DUuniqInstance,
req->rnti, req->rnti,
drb_p.drb_id, drb_p.drb_id,
...@@ -3297,6 +3303,10 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha ...@@ -3297,6 +3303,10 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
} }
} }
NR_CellGroupConfig_t *cellGroupConfig;
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
fill_mastercellGroupConfig(cellGroupConfig, ue_context_p->ue_context.masterCellGroup, rrc->um_on_default_drb, SRB2_config ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
apply_macrlc_config(rrc, ue_context_p, &ctxt); apply_macrlc_config(rrc, ue_context_p, &ctxt);
/* Fill the UE context setup response ITTI message to send to F1AP */ /* Fill the UE context setup response ITTI message to send to F1AP */
resp->gNB_CU_ue_id = req->gNB_CU_ue_id; resp->gNB_CU_ue_id = req->gNB_CU_ue_id;
......
...@@ -905,7 +905,7 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP( ...@@ -905,7 +905,7 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(
for (pdusession = 0; pdusession < ue_context_pP->ue_context.setup_pdu_sessions; pdusession++) { for (pdusession = 0; pdusession < ue_context_pP->ue_context.setup_pdu_sessions; pdusession++) {
// if (xid == ue_context_pP->ue_context.pdusession[pdusession].xid) { // if (xid == ue_context_pP->ue_context.pdusession[pdusession].xid) {
if (ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_DONE) { if (ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_DONE) {
pdusession_setup_t * tmp=&NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession]; pdusession_setup_t * tmp=&NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdu_sessions_done];
tmp->pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id; tmp->pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id;
// tmp->pdusession_id = 1; // tmp->pdusession_id = 1;
tmp->nb_of_qos_flow = ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos; tmp->nb_of_qos_flow = ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos;
......
...@@ -450,7 +450,7 @@ nr_sdap_entity_t *nr_sdap_get_entity(uint16_t rnti, int pdusession_id) { ...@@ -450,7 +450,7 @@ nr_sdap_entity_t *nr_sdap_get_entity(uint16_t rnti, int pdusession_id) {
if(sdap_entity == NULL) if(sdap_entity == NULL)
return NULL; return NULL;
while(sdap_entity->rnti != rnti && sdap_entity->next_entity != NULL) { while(( sdap_entity->rnti != rnti || sdap_entity->pdusession_id != pdusession_id ) && sdap_entity->next_entity != NULL) {
sdap_entity = sdap_entity->next_entity; sdap_entity = sdap_entity->next_entity;
} }
...@@ -460,6 +460,7 @@ nr_sdap_entity_t *nr_sdap_get_entity(uint16_t rnti, int pdusession_id) { ...@@ -460,6 +460,7 @@ nr_sdap_entity_t *nr_sdap_get_entity(uint16_t rnti, int pdusession_id) {
return NULL; return NULL;
} }
void delete_nr_sdap_entity(uint16_t rnti) { void delete_nr_sdap_entity(uint16_t rnti) {
nr_sdap_entity_t *entityPtr, *entityPrev = NULL; nr_sdap_entity_t *entityPtr, *entityPrev = NULL;
entityPtr = sdap_info.sdap_entity_llist; entityPtr = sdap_info.sdap_entity_llist;
......
...@@ -462,7 +462,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer ...@@ -462,7 +462,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer
auto inst=&globGtp.instances[instance]; auto inst=&globGtp.instances[instance];
auto it=inst->ue2te_mapping.find(rnti); auto it=inst->ue2te_mapping.find(rnti);
if ( it != inst->ue2te_mapping.end() ) { if ( it != inst->ue2te_mapping.end() && it->second.bearers.find(outgoing_bearer_id) != it->second.bearers.end()) {
LOG_W(GTPU,"[%ld] Create a config for a already existing GTP tunnel (rnti %x)\n", instance, rnti); LOG_W(GTPU,"[%ld] Create a config for a already existing GTP tunnel (rnti %x)\n", instance, rnti);
inst->ue2te_mapping.erase(it); inst->ue2te_mapping.erase(it);
} }
......
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