NR RRC - RRCReestablishment - Apply clang format

parent 3cf3a42b
......@@ -295,7 +295,7 @@ typedef struct drb_s {
int pdcp_SN_SizeDL;
int t_Reordering;
int integrityProtection;
struct headerCompression_s{
struct headerCompression_s {
int NotUsed;
int present;
} headerCompression;
......
......@@ -1301,13 +1301,16 @@ void RRCReestablishmentComplete_fill_SRB2_configList(const protocol_ctxt_t *cons
// get old configuration of SRB2
if (*SRB_configList2 != NULL) {
if((*SRB_configList2)->list.count!=0) {
LOG_D(NR_RRC, "RRC Reestablishment - SRB_configList2(%p) count is %d\n SRB_configList2->list.array[0] addr is %p\n",
SRB_configList2, (*SRB_configList2)->list.count, (*SRB_configList2)->list.array[0]);
if ((*SRB_configList2)->list.count != 0) {
LOG_D(NR_RRC,
"RRC Reestablishment - SRB_configList2(%p) count is %d\n SRB_configList2->list.array[0] addr is %p\n",
SRB_configList2,
(*SRB_configList2)->list.count,
(*SRB_configList2)->list.array[0]);
}
for (int i = 0; (i < (*SRB_configList2)->list.count) && (i < 3); i++) {
if ((*SRB_configList2)->list.array[i]->srb_Identity == 2 ) {
if ((*SRB_configList2)->list.array[i]->srb_Identity == 2) {
LOG_D(NR_RRC, "RRC Reestablishment - get SRB2_config from (ue_p->SRB_configList2[%d])\n", old_xid);
SRB2_config = (*SRB_configList2)->list.array[i];
SRB2_config->reestablishPDCP = CALLOC(1, sizeof(*SRB2_config->reestablishPDCP));
......@@ -1331,10 +1334,13 @@ void RRCReestablishmentComplete_fill_SRB2_configList(const protocol_ctxt_t *cons
asn1cSeqAdd(&SRB_configList->list, SRB2_config);
asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config);
LOG_D(NR_RRC, "RRC Reestablishment - Add SRB2_config (srb_Identity:%ld) to ue_p->SRB_configList\n", SRB2_config->srb_Identity);
LOG_D(NR_RRC, "RRC Reestablishment - Add SRB2_config (srb_Identity:%ld) to ue_p->SRB_configList2[%d]\n", SRB2_config->srb_Identity, new_xid);
LOG_D(NR_RRC,
"RRC Reestablishment - Add SRB2_config (srb_Identity:%ld) to ue_p->SRB_configList2[%d]\n",
SRB2_config->srb_Identity,
new_xid);
} else {
// SRB configuration list only contains SRB1.
LOG_W(NR_RRC,"RRC Reestablishment - SRB2 configuration does not exist in SRB configuration list\n");
LOG_W(NR_RRC, "RRC Reestablishment - SRB2 configuration does not exist in SRB configuration list\n");
}
ue_p->Srb[1].Active = 1;
......@@ -1388,13 +1394,13 @@ void RRCReestablishmentComplete_update_ngu_tunnel(const protocol_ctxt_t *const c
if (get_softmodem_params()->sa) {
LOG_W(NR_RRC, "RRC Reestablishment - Rework identity mapping need to be done properly!\n");
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req={0};
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req = {0};
/* Save e RAB information for later */
for (j = 0, i = 0; i < NB_RB_MAX; i++) {
if (ue_p->pduSession[i].status == PDU_SESSION_STATUS_ESTABLISHED || ue_p->pduSession[i].status == PDU_SESSION_STATUS_DONE) {
create_tunnel_req.pdusession_id[j] = ue_p->pduSession[i].param.pdusession_id;
create_tunnel_req.incoming_rb_id[j] = i+1;
create_tunnel_req.incoming_rb_id[j] = i + 1;
create_tunnel_req.outgoing_teid[j] = ue_p->pduSession[i].param.gtp_teid;
// to be developped, use the first QFI only
create_tunnel_req.outgoing_qfi[j] = ue_p->pduSession[i].param.qos[0].qfi;
......@@ -1406,11 +1412,9 @@ void RRCReestablishmentComplete_update_ngu_tunnel(const protocol_ctxt_t *const c
create_tunnel_req.ue_id = ctxt_pP->rntiMaybeUEid; // warning put zero above
create_tunnel_req.num_tunnels = j;
ret = gtpv1u_update_ngu_tunnel(ctxt_pP->instance,
&create_tunnel_req,
reestablish_rnti);
ret = gtpv1u_update_ngu_tunnel(ctxt_pP->instance, &create_tunnel_req, reestablish_rnti);
if ( ret != 0 ) {
if (ret != 0) {
LOG_E(NR_RRC, "RRC Reestablishment - gtpv1u_update_ngu_tunnel failed,start to release UE %x\n", reestablish_rnti);
ue_p->ue_release_timer_s1 = 1;
ue_p->ue_release_timer_thres_s1 = 100;
......@@ -1427,15 +1431,18 @@ void RRCReestablishmentComplete_update_ngu_tunnel(const protocol_ctxt_t *const c
/// @param old_xid Refers to the old transaction identifier passed to rrc_gNB_process_RRCReestablishmentComplete as xid.
/// @todo parameters yet to process inside the for loop.
/// @todo should test if pdu session are Ok before! inside the for loop.
void RRCReestablishmentComplete_nas_pdu_update(rrc_gNB_ue_context_t *ue_context_pP,
const uint8_t old_xid)
void RRCReestablishmentComplete_nas_pdu_update(rrc_gNB_ue_context_t *ue_context_pP, const uint8_t old_xid)
{
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
/* Add all NAS PDUs to the list */
for (int i = 0; i < ue_p->nb_of_pdusessions; i++) {
ue_p->pduSession[i].status = PDU_SESSION_STATUS_DONE;
ue_p->pduSession[i].xid = old_xid;
LOG_D(NR_RRC, "RRC Reestablishment - setting the status for the default DRB (index %d) to (%d,%s)\n", i, ue_p->pduSession[i].status, "PDU_SESSION_STATUS_DONE");
LOG_D(NR_RRC,
"RRC Reestablishment - setting the status for the default DRB (index %d) to (%d,%s)\n",
i,
ue_p->pduSession[i].status,
"PDU_SESSION_STATUS_DONE");
}
}
......@@ -1464,7 +1471,9 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
const uint8_t xid)
{
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
LOG_I(NR_RRC, "[RAPROC] UE %04x Logical Channel UL-DCCH, processing NR_RRCReestablishmentComplete from UE (SRB1 Active)\n", ue_p->rnti);
LOG_I(NR_RRC,
"[RAPROC] UE %04x Logical Channel UL-DCCH, processing NR_RRCReestablishmentComplete from UE (SRB1 Active)\n",
ue_p->rnti);
int i = 0;
......@@ -1496,10 +1505,17 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
/* TODO: hardcoded to 13 for the time being, to be changed? */
long drb_priority[NGAP_MAX_DRBS_PER_UE] = {13};
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);
for(i = 0; i < cellGroupConfig->rlc_BearerToAddModList->list.count; i++) {
cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC = CALLOC(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC));
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);
for (i = 0; i < cellGroupConfig->rlc_BearerToAddModList->list.count; i++) {
cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC =
CALLOC(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC));
*cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC = NR_RLC_BearerConfig__reestablishRLC_true;
}
......@@ -1521,7 +1537,7 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
NULL,
cellGroupConfig);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n");
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n");
RRCReestablishmentComplete_nas_pdu_free(ue_context_pP);
......@@ -1529,9 +1545,15 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
LOG_E(NR_RRC, "RRC decode err!!! do_RRCReconfiguration\n");
return;
} else {
LOG_I(NR_RRC, "[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate NR_RRCReconfiguration (bytes %d, UE id %04x)\n", ctxt_pP->module_id, ctxt_pP->frame, size, ue_p->rnti);
LOG_I(NR_RRC,
"[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate NR_RRCReconfiguration (bytes %d, UE id %04x)\n",
ctxt_pP->module_id,
ctxt_pP->frame,
size,
ue_p->rnti);
LOG_D(NR_RRC,
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (RRCReconfiguration to UE %04x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (RRCReconfiguration to UE %04x MUI %d) --->][PDCP][MOD "
"%u][RB %u]\n",
ctxt_pP->frame,
ctxt_pP->module_id,
size,
......@@ -1545,12 +1567,16 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
}
if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
uint32_t delay_ms = ue_p->masterCellGroup && ue_p->masterCellGroup->spCellConfig && ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated
uint32_t delay_ms = ue_p->masterCellGroup && ue_p->masterCellGroup->spCellConfig
&& ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated
&& ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList
? NR_RRC_RECONFIGURATION_DELAY_MS + NR_RRC_BWP_SWITCHING_DELAY_MS
: NR_RRC_RECONFIGURATION_DELAY_MS;
nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, ue_p->rnti, *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, delay_ms);
nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id,
ue_p->rnti,
*RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing,
delay_ms);
}
}
//-----------------------------------------------------------------------------
......
......@@ -51,9 +51,9 @@ void generateDRB(gNB_RRC_UE_t *ue,
ue->established_drbs[drb_id - 1].reestablishPDCP = -1;
ue->established_drbs[drb_id - 1].recoverPDCP = -1;
for (i = 0; i < NGAP_MAX_DRBS_PER_UE; i++) {
if ((ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.pdusession_id == 0 ||
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.pdusession_id == pduSession->param.pdusession_id) &&
ue->established_drbs[drb_id - 1].defaultDRBid == 0) {
if ((ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.pdusession_id == 0
|| ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.pdusession_id == pduSession->param.pdusession_id)
&& ue->established_drbs[drb_id - 1].defaultDRBid == 0) {
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.defaultDRB = true;
ue->established_drbs[drb_id - 1].defaultDRBid = drb_id;
}
......@@ -68,10 +68,10 @@ void generateDRB(gNB_RRC_UE_t *ue,
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_absent;
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_absent;
}
for (qos_flow_index = 0; qos_flow_index < pduSession->param.nb_qos; qos_flow_index++)
{
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index] = pduSession->param.qos[qos_flow_index].qfi;
if(pduSession->param.qos[qos_flow_index].fiveQI > 5)
for (qos_flow_index = 0; qos_flow_index < pduSession->param.nb_qos; qos_flow_index++) {
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index] =
pduSession->param.qos[qos_flow_index].qfi;
if (pduSession->param.qos[qos_flow_index].fiveQI > 5)
ue->established_drbs[drb_id - 1].status = DRB_ACTIVE_NONGBR;
else
ue->established_drbs[drb_id - 1].status = DRB_ACTIVE;
......@@ -91,7 +91,6 @@ void generateDRB(gNB_RRC_UE_t *ue,
ue->established_drbs[drb_id - 1].pdcp_config.ext1.cipheringDisabled = 1;
else
ue->established_drbs[drb_id - 1].pdcp_config.ext1.cipheringDisabled = NR_PDCP_Config__ext1__cipheringDisabled_true;
}
}
......@@ -114,9 +113,8 @@ NR_DRB_ToAddMod_t *generateDRB_ASN1(drb_t drb_asn1)
SDAP_config->sdap_HeaderUL = drb_asn1.cnAssociation.sdap_config.sdap_HeaderUL;
SDAP_config->defaultDRB = drb_asn1.cnAssociation.sdap_config.defaultDRB;
for (int qos_flow_index = 0; qos_flow_index < QOSFLOW_MAX_VALUE; qos_flow_index++)
{
if(drb_asn1.cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index] != 0) {
for (int qos_flow_index = 0; qos_flow_index < QOSFLOW_MAX_VALUE; qos_flow_index++) {
if (drb_asn1.cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index] != 0) {
asn1cSequenceAdd(sdapFlows->list, NR_QFI_t, qfi);
*qfi = drb_asn1.cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index];
}
......
......@@ -47,7 +47,12 @@ NR_DRB_ToAddMod_t *generateDRB_ASN1(drb_t drb_asn1);
/// @param enable_sdap If true the SDAP header will be added to the packet, else it will not add or search for SDAP header.
/// @param do_drb_integrity
/// @param do_drb_ciphering
void generateDRB(gNB_RRC_UE_t *ue, uint8_t drb_id, rrc_pdu_session_param_t *pduSession, bool enable_sdap, int do_drb_integrity, int do_drb_ciphering);
void generateDRB(gNB_RRC_UE_t *ue,
uint8_t drb_id,
rrc_pdu_session_param_t *pduSession,
bool enable_sdap,
int do_drb_integrity,
int do_drb_ciphering);
uint8_t next_available_drb(gNB_RRC_UE_t *ue, rrc_pdu_session_param_t *pdusession, bool is_gbr);
bool drb_is_active(gNB_RRC_UE_t *ue, uint8_t drb_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