Commit 216c4235 authored by francescomani's avatar francescomani

remove unnecessary storage of SIBs structures at RRC

parent 086ac798
...@@ -185,102 +185,61 @@ static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si) ...@@ -185,102 +185,61 @@ static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si)
LOG_I(NR_RRC, "Found SIB%d\n", typeandinfo->present + 1); LOG_I(NR_RRC, "Found SIB%d\n", typeandinfo->present + 1);
switch(typeandinfo->present) { switch(typeandinfo->present) {
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib2: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib2:
if(!SI_info->sib2) SI_info->sib2_validity = true;
SI_info->sib2 = calloc(1, sizeof(*SI_info->sib2));
memcpy(SI_info->sib2, typeandinfo->choice.sib2, sizeof(NR_SIB2_t));
nr_timer_start(&SI_info->sib2_timer); nr_timer_start(&SI_info->sib2_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib3: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib3:
if(!SI_info->sib3) SI_info->sib3_validity = true;
SI_info->sib3 = calloc(1, sizeof(*SI_info->sib3));
memcpy(SI_info->sib3, typeandinfo->choice.sib3, sizeof(NR_SIB3_t));
nr_timer_start(&SI_info->sib3_timer); nr_timer_start(&SI_info->sib3_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib4: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib4:
if(!SI_info->sib4) SI_info->sib4_validity = true;
SI_info->sib4 = calloc(1, sizeof(*SI_info->sib4));
memcpy(SI_info->sib4, typeandinfo->choice.sib4, sizeof(NR_SIB4_t));
nr_timer_start(&SI_info->sib4_timer); nr_timer_start(&SI_info->sib4_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib5: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib5:
if(!SI_info->sib5) SI_info->sib5_validity = true;
SI_info->sib5 = calloc(1, sizeof(*SI_info->sib5));
memcpy(SI_info->sib5, typeandinfo->choice.sib5, sizeof(NR_SIB5_t));
nr_timer_start(&SI_info->sib5_timer); nr_timer_start(&SI_info->sib5_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib6: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib6:
if(!SI_info->sib6) SI_info->sib6_validity = true;
SI_info->sib6 = calloc(1, sizeof(*SI_info->sib6));
memcpy(SI_info->sib6, typeandinfo->choice.sib6, sizeof(NR_SIB6_t));
nr_timer_start(&SI_info->sib6_timer); nr_timer_start(&SI_info->sib6_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib7: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib7:
if(!SI_info->sib7) SI_info->sib7_validity = true;
SI_info->sib7 = calloc(1, sizeof(*SI_info->sib7));
memcpy(SI_info->sib7, typeandinfo->choice.sib7, sizeof(NR_SIB7_t));
nr_timer_start(&SI_info->sib7_timer); nr_timer_start(&SI_info->sib7_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib8: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib8:
if(!SI_info->sib8) SI_info->sib8_validity = true;
SI_info->sib8 = calloc(1, sizeof(*SI_info->sib8));
memcpy(SI_info->sib8, typeandinfo->choice.sib8, sizeof(NR_SIB8_t));
nr_timer_start(&SI_info->sib8_timer); nr_timer_start(&SI_info->sib8_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib9: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib9:
if(!SI_info->sib9) SI_info->sib9_validity = true;
SI_info->sib9 = calloc(1, sizeof(*SI_info->sib9));
memcpy(SI_info->sib9, typeandinfo->choice.sib9, sizeof(NR_SIB9_t));
nr_timer_start(&SI_info->sib9_timer); nr_timer_start(&SI_info->sib9_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib10_v1610: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib10_v1610:
if(!SI_info->sib10) SI_info->sib10_validity = true;
SI_info->sib10 = calloc(1, sizeof(*SI_info->sib10));
memcpy(SI_info->sib10, typeandinfo->choice.sib10_v1610, sizeof(NR_SIB10_r16_t));
nr_timer_start(&SI_info->sib10_timer); nr_timer_start(&SI_info->sib10_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib11_v1610: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib11_v1610:
if(!SI_info->sib11) SI_info->sib11_validity = true;
SI_info->sib11 = calloc(1, sizeof(*SI_info->sib11));
memcpy(SI_info->sib11, typeandinfo->choice.sib11_v1610, sizeof(NR_SIB11_r16_t));
nr_timer_start(&SI_info->sib11_timer); nr_timer_start(&SI_info->sib11_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib12_v1610: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib12_v1610:
if(!SI_info->sib12) SI_info->sib12_validity = true;
SI_info->sib12 = calloc(1, sizeof(*SI_info->sib12));
memcpy(SI_info->sib12, typeandinfo->choice.sib12_v1610, sizeof(NR_SIB12_r16_t));
nr_timer_start(&SI_info->sib12_timer); nr_timer_start(&SI_info->sib12_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib13_v1610: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib13_v1610:
if(!SI_info->sib13) SI_info->sib13_validity = true;
SI_info->sib13 = calloc(1, sizeof(*SI_info->sib13));
memcpy(SI_info->sib13, typeandinfo->choice.sib13_v1610, sizeof(NR_SIB13_r16_t));
nr_timer_start(&SI_info->sib13_timer); nr_timer_start(&SI_info->sib13_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib14_v1610: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib14_v1610:
if(!SI_info->sib14) SI_info->sib14_validity = true;
SI_info->sib14 = calloc(1, sizeof(*SI_info->sib14));
memcpy(SI_info->sib12, typeandinfo->choice.sib14_v1610, sizeof(NR_SIB14_r16_t));
nr_timer_start(&SI_info->sib14_timer); nr_timer_start(&SI_info->sib14_timer);
break; break;
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib19_v1700: case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib19_v1700:
if(!SI_info->SInfo_r17.sib19) SI_info->SInfo_r17.sib19_validity = true;
SI_info->SInfo_r17.sib19 = calloc(1, sizeof(*SI_info->SInfo_r17.sib19));
asn_copy(&asn_DEF_NR_SIB19_r17, (void **) &SI_info->SInfo_r17.sib19, typeandinfo->choice.sib19_v1700);
if (g_log->log_component[NR_RRC].level >= OAILOG_DEBUG) if (g_log->log_component[NR_RRC].level >= OAILOG_DEBUG)
xer_fprint(stdout, &asn_DEF_NR_SIB19_r17, (const void *)SI_info->SInfo_r17.sib19); xer_fprint(stdout, &asn_DEF_NR_SIB19_r17, (const void *)typeandinfo->choice.sib19_v1700);
nr_timer_start(&SI_info->SInfo_r17.sib19_timer); nr_timer_start(&SI_info->SInfo_r17.sib19_timer);
break; break;
default: default:
...@@ -311,17 +270,10 @@ static void nr_rrc_ue_prepare_RRCSetupRequest(NR_UE_RRC_INST_t *rrc) ...@@ -311,17 +270,10 @@ static void nr_rrc_ue_prepare_RRCSetupRequest(NR_UE_RRC_INST_t *rrc)
nr_rlc_srb_recv_sdu(rrc->ue_id, 0, buf, len); nr_rlc_srb_recv_sdu(rrc->ue_id, 0, buf, len);
} }
static void nr_rrc_configure_default_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SIB1_t *sib1) static void nr_rrc_configure_default_SI(NR_UE_RRC_SI_INFO *SI_info,
struct NR_SI_SchedulingInfo *si_SchedulingInfo,
struct NR_SI_SchedulingInfo_v1700 *si_SchedulingInfo_v1700)
{ {
struct NR_SI_SchedulingInfo *si_SchedulingInfo = sib1->si_SchedulingInfo;
struct NR_SI_SchedulingInfo_v1700 *si_SchedulingInfo_v1700 = NULL;
if (sib1->nonCriticalExtension && sib1->nonCriticalExtension->nonCriticalExtension
&& sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension
&& sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700) {
si_SchedulingInfo_v1700 = sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700;
}
if (si_SchedulingInfo) { if (si_SchedulingInfo) {
SI_info->default_otherSI_map = 0; SI_info->default_otherSI_map = 0;
for (int i = 0; i < si_SchedulingInfo->schedulingInfoList.list.count; i++) { for (int i = 0; i < si_SchedulingInfo->schedulingInfoList.list.count; i++) {
...@@ -347,30 +299,34 @@ static void nr_rrc_configure_default_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SIB1_t *s ...@@ -347,30 +299,34 @@ static void nr_rrc_configure_default_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SIB1_t *s
} }
} }
static void nr_rrc_process_sib1(NR_UE_RRC_INST_t *rrc, NR_UE_RRC_SI_INFO *SI_info, NR_SIB1_t *systemInformationBlockType1) static void nr_rrc_process_sib1(NR_UE_RRC_INST_t *rrc, NR_UE_RRC_SI_INFO *SI_info, NR_SIB1_t *sib1)
{ {
UPDATE_IE(SI_info->sib1, systemInformationBlockType1, NR_SIB1_t);
if(g_log->log_component[NR_RRC].level >= OAILOG_DEBUG) if(g_log->log_component[NR_RRC].level >= OAILOG_DEBUG)
xer_fprint(stdout, &asn_DEF_NR_SIB1, (const void *) SI_info->sib1); xer_fprint(stdout, &asn_DEF_NR_SIB1, (const void *) sib1);
LOG_A(NR_RRC, "SIB1 decoded\n"); LOG_A(NR_RRC, "SIB1 decoded\n");
nr_timer_start(&SI_info->sib1_timer); nr_timer_start(&SI_info->sib1_timer);
SI_info->sib1_validity = true;
if (rrc->nrRrcState == RRC_STATE_IDLE_NR) { if (rrc->nrRrcState == RRC_STATE_IDLE_NR) {
rrc->ra_trigger = RRC_CONNECTION_SETUP; rrc->ra_trigger = RRC_CONNECTION_SETUP;
// preparing RRC setup request payload in advance // preparing RRC setup request payload in advance
nr_rrc_ue_prepare_RRCSetupRequest(rrc); nr_rrc_ue_prepare_RRCSetupRequest(rrc);
} }
// configure default SI
nr_rrc_configure_default_SI(SI_info, SI_info->sib1);
// configure timers and constant
nr_rrc_set_sib1_timers_and_constants(&rrc->timers_and_constants, SI_info->sib1);
NR_SI_SchedulingInfo_v1700_t *si_SchedulingInfo_v1700 = NULL; NR_SI_SchedulingInfo_v1700_t *si_SchedInfo_v1700 = NULL;
if (SI_info->sib1->nonCriticalExtension && SI_info->sib1->nonCriticalExtension->nonCriticalExtension if (sib1->nonCriticalExtension
&& SI_info->sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension) { && sib1->nonCriticalExtension->nonCriticalExtension
si_SchedulingInfo_v1700 = SI_info->sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700; && sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension) {
si_SchedInfo_v1700 = sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700;
} }
nr_rrc_mac_config_req_sib1(rrc->ue_id, 0, SI_info->sib1->si_SchedulingInfo, si_SchedulingInfo_v1700, SI_info->sib1->servingCellConfigCommon); // configure default SI
nr_rrc_configure_default_SI(SI_info, sib1->si_SchedulingInfo, si_SchedInfo_v1700);
// configure timers and constant
nr_rrc_set_sib1_timers_and_constants(&rrc->timers_and_constants, sib1);
// RRC storage of SIB1 timers and constants (eg needed in re-establishment)
UPDATE_IE(rrc->timers_and_constants.sib1_TimersAndConstants, sib1->ue_TimersAndConstants, NR_UE_TimersAndConstants_t);
nr_rrc_mac_config_req_sib1(rrc->ue_id, 0, sib1->si_SchedulingInfo, si_SchedInfo_v1700, sib1->servingCellConfigCommon);
} }
static void nr_rrc_process_reconfiguration_v1530(NR_UE_RRC_INST_t *rrc, NR_RRCReconfiguration_v1530_IEs_t *rec_1530, int gNB_index) static void nr_rrc_process_reconfiguration_v1530(NR_UE_RRC_INST_t *rrc, NR_RRCReconfiguration_v1530_IEs_t *rec_1530, int gNB_index)
...@@ -655,55 +611,55 @@ bool check_si_validity(NR_UE_RRC_SI_INFO *SI_info, int si_type) ...@@ -655,55 +611,55 @@ bool check_si_validity(NR_UE_RRC_SI_INFO *SI_info, int si_type)
{ {
switch (si_type) { switch (si_type) {
case NR_SIB_TypeInfo__type_sibType2: case NR_SIB_TypeInfo__type_sibType2:
if (!SI_info->sib2) if (!SI_info->sib2_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType3: case NR_SIB_TypeInfo__type_sibType3:
if (!SI_info->sib3) if (!SI_info->sib3_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType4: case NR_SIB_TypeInfo__type_sibType4:
if (!SI_info->sib4) if (!SI_info->sib4_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType5: case NR_SIB_TypeInfo__type_sibType5:
if (!SI_info->sib5) if (!SI_info->sib5_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType6: case NR_SIB_TypeInfo__type_sibType6:
if (!SI_info->sib6) if (!SI_info->sib6_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType7: case NR_SIB_TypeInfo__type_sibType7:
if (!SI_info->sib7) if (!SI_info->sib7_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType8: case NR_SIB_TypeInfo__type_sibType8:
if (!SI_info->sib8) if (!SI_info->sib8_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType9: case NR_SIB_TypeInfo__type_sibType9:
if (!SI_info->sib9) if (!SI_info->sib9_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType10_v1610: case NR_SIB_TypeInfo__type_sibType10_v1610:
if (!SI_info->sib10) if (!SI_info->sib10_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType11_v1610: case NR_SIB_TypeInfo__type_sibType11_v1610:
if (!SI_info->sib11) if (!SI_info->sib11_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType12_v1610: case NR_SIB_TypeInfo__type_sibType12_v1610:
if (!SI_info->sib12) if (!SI_info->sib12_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType13_v1610: case NR_SIB_TypeInfo__type_sibType13_v1610:
if (!SI_info->sib13) if (!SI_info->sib13_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo__type_sibType14_v1610: case NR_SIB_TypeInfo__type_sibType14_v1610:
if (!SI_info->sib14) if (!SI_info->sib14_validity)
return false; return false;
break; break;
default : default :
...@@ -716,31 +672,31 @@ bool check_si_validity_r17(NR_UE_RRC_SI_INFO_r17 *SI_info, int si_type) ...@@ -716,31 +672,31 @@ bool check_si_validity_r17(NR_UE_RRC_SI_INFO_r17 *SI_info, int si_type)
{ {
switch (si_type) { switch (si_type) {
case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType15: case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType15:
if (!SI_info->sib15) if (!SI_info->sib15_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType16: case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType16:
if (!SI_info->sib16) if (!SI_info->sib16_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType17: case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType17:
if (!SI_info->sib17) if (!SI_info->sib17_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType18: case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType18:
if (!SI_info->sib18) if (!SI_info->sib18_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType19: case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType19:
if (!SI_info->sib19) if (!SI_info->sib19_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType20: case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType20:
if (!SI_info->sib20) if (!SI_info->sib20_validity)
return false; return false;
break; break;
case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType21: case NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType21:
if (!SI_info->sib21) if (!SI_info->sib21_validity)
return false; return false;
break; break;
default : default :
...@@ -752,10 +708,10 @@ bool check_si_validity_r17(NR_UE_RRC_SI_INFO_r17 *SI_info, int si_type) ...@@ -752,10 +708,10 @@ bool check_si_validity_r17(NR_UE_RRC_SI_INFO_r17 *SI_info, int si_type)
int check_si_status(NR_UE_RRC_SI_INFO *SI_info) int check_si_status(NR_UE_RRC_SI_INFO *SI_info)
{ {
// schedule reception of SIB1 if RRC doesn't have it // schedule reception of SIB1 if RRC doesn't have it
if (!SI_info->sib1) if (!SI_info->sib1_validity)
return 1; return 1;
else { else {
if (SI_info->sib1->si_SchedulingInfo) { if (SI_info->default_otherSI_map) {
// Check if RRC has configured default SI // Check if RRC has configured default SI
// from SIB2 to SIB14 as current ASN1 version // from SIB2 to SIB14 as current ASN1 version
// TODO can be used for on demand SI when (if) implemented // TODO can be used for on demand SI when (if) implemented
...@@ -2124,18 +2080,15 @@ static void nr_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc, NR_UECa ...@@ -2124,18 +2080,15 @@ static void nr_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc, NR_UECa
ASN_STRUCT_RESET(asn_DEF_NR_UL_DCCH_Message, &ul_dcch_msg); ASN_STRUCT_RESET(asn_DEF_NR_UL_DCCH_Message, &ul_dcch_msg);
} }
void nr_rrc_initiate_rrcReestablishment(NR_UE_RRC_INST_t *rrc, static void nr_rrc_initiate_rrcReestablishment(NR_UE_RRC_INST_t *rrc, NR_ReestablishmentCause_t cause)
NR_ReestablishmentCause_t cause,
const int gnb_id)
{ {
rrc->reestablishment_cause = cause; rrc->reestablishment_cause = cause;
NR_UE_Timers_Constants_t *timers = &rrc->timers_and_constants; NR_UE_Timers_Constants_t *timers = &rrc->timers_and_constants;
rrcPerNB_t *rrcNB = rrc->perNB + gnb_id;
// reset timers to SIB1 as part of release of spCellConfig // reset timers to SIB1 as part of release of spCellConfig
// it needs to be done before handling timers // it needs to be done before handling timers
set_rlf_sib1_timers_and_constants(timers, rrcNB->SInfo.sib1); set_rlf_sib1_timers_and_constants(timers, rrc->timers_and_constants.sib1_TimersAndConstants);
// stop timer T310, if running // stop timer T310, if running
nr_timer_stop(&timers->T310); nr_timer_stop(&timers->T310);
...@@ -2404,7 +2357,7 @@ void handle_rlf_detection(NR_UE_RRC_INST_t *rrc) ...@@ -2404,7 +2357,7 @@ void handle_rlf_detection(NR_UE_RRC_INST_t *rrc)
} }
if (rrc->as_security_activated && srb2 && any_drb) // initiate the connection re-establishment procedure if (rrc->as_security_activated && srb2 && any_drb) // initiate the connection re-establishment procedure
nr_rrc_initiate_rrcReestablishment(rrc, NR_ReestablishmentCause_otherFailure, 0); nr_rrc_initiate_rrcReestablishment(rrc, NR_ReestablishmentCause_otherFailure);
else { else {
NR_Release_Cause_t cause = rrc->as_security_activated ? RRC_CONNECTION_FAILURE : OTHER; NR_Release_Cause_t cause = rrc->as_security_activated ? RRC_CONNECTION_FAILURE : OTHER;
nr_rrc_going_to_IDLE(rrc, cause, NULL); nr_rrc_going_to_IDLE(rrc, cause, NULL);
...@@ -2499,24 +2452,33 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc, ...@@ -2499,24 +2452,33 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc,
rrcPerNB_t *nb = &rrc->perNB[i]; rrcPerNB_t *nb = &rrc->perNB[i];
NR_UE_RRC_SI_INFO *SI_info = &nb->SInfo; NR_UE_RRC_SI_INFO *SI_info = &nb->SInfo;
init_SI_timers(SI_info); init_SI_timers(SI_info);
asn1cFreeStruc(asn_DEF_NR_SIB1, SI_info->sib1); SI_info->sib1_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB2, SI_info->sib2); SI_info->sib2_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB3, SI_info->sib3); SI_info->sib3_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB4, SI_info->sib4); SI_info->sib4_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB5, SI_info->sib5); SI_info->sib5_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB6, SI_info->sib6); SI_info->sib6_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB7, SI_info->sib7); SI_info->sib7_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB8, SI_info->sib8); SI_info->sib8_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB9, SI_info->sib9); SI_info->sib9_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB10_r16, SI_info->sib10); SI_info->sib10_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB11_r16, SI_info->sib11); SI_info->sib11_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB12_r16, SI_info->sib12); SI_info->sib12_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB13_r16, SI_info->sib13); SI_info->sib13_validity = false;
asn1cFreeStruc(asn_DEF_NR_SIB14_r16, SI_info->sib14); SI_info->sib14_validity = false;
} SI_info->SInfo_r17.sib15_validity = false;
SI_info->SInfo_r17.sib16_validity = false;
if (rrc->nrRrcState == RRC_STATE_DETACH_NR) SI_info->SInfo_r17.sib17_validity = false;
SI_info->SInfo_r17.sib18_validity = false;
SI_info->SInfo_r17.sib19_validity = false;
SI_info->SInfo_r17.sib20_validity = false;
SI_info->SInfo_r17.sib21_validity = false;
}
if (rrc->nrRrcState == RRC_STATE_DETACH_NR) {
asn1cFreeStruc(asn_DEF_NR_UE_NR_Capability, rrc->UECap.UE_NR_Capability); asn1cFreeStruc(asn_DEF_NR_UE_NR_Capability, rrc->UECap.UE_NR_Capability);
asn1cFreeStruc(asn_DEF_NR_UE_TimersAndConstants, tac->sib1_TimersAndConstants);
}
// reset MAC // reset MAC
NR_UE_MAC_reset_cause_t cause = (rrc->nrRrcState == RRC_STATE_DETACH_NR) ? DETACH : GO_TO_IDLE; NR_UE_MAC_reset_cause_t cause = (rrc->nrRrcState == RRC_STATE_DETACH_NR) ? DETACH : GO_TO_IDLE;
......
...@@ -106,51 +106,51 @@ typedef enum RA_trigger_e { ...@@ -106,51 +106,51 @@ typedef enum RA_trigger_e {
typedef struct UE_RRC_SI_INFO_NR_r17_s { typedef struct UE_RRC_SI_INFO_NR_r17_s {
uint32_t default_otherSI_map_r17; uint32_t default_otherSI_map_r17;
NR_SIB15_r17_t *sib15; bool sib15_validity;
NR_timer_t sib15_timer; NR_timer_t sib15_timer;
NR_SIB16_r17_t *sib16; bool sib16_validity;
NR_timer_t sib16_timer; NR_timer_t sib16_timer;
NR_SIB17_r17_t *sib17; bool sib17_validity;
NR_timer_t sib17_timer; NR_timer_t sib17_timer;
NR_SIB18_r17_t *sib18; bool sib18_validity;
NR_timer_t sib18_timer; NR_timer_t sib18_timer;
NR_SIB19_r17_t *sib19; bool sib19_validity;
NR_timer_t sib19_timer; NR_timer_t sib19_timer;
NR_SIB20_r17_t *sib20; bool sib20_validity;
NR_timer_t sib20_timer; NR_timer_t sib20_timer;
NR_SIB21_r17_t *sib21; bool sib21_validity;
NR_timer_t sib21_timer; NR_timer_t sib21_timer;
} NR_UE_RRC_SI_INFO_r17; } NR_UE_RRC_SI_INFO_r17;
typedef struct UE_RRC_SI_INFO_NR_s { typedef struct UE_RRC_SI_INFO_NR_s {
uint32_t default_otherSI_map; uint32_t default_otherSI_map;
NR_SIB1_t *sib1; bool sib1_validity;
NR_timer_t sib1_timer; NR_timer_t sib1_timer;
NR_SIB2_t *sib2; bool sib2_validity;
NR_timer_t sib2_timer; NR_timer_t sib2_timer;
NR_SIB3_t *sib3; bool sib3_validity;
NR_timer_t sib3_timer; NR_timer_t sib3_timer;
NR_SIB4_t *sib4; bool sib4_validity;
NR_timer_t sib4_timer; NR_timer_t sib4_timer;
NR_SIB5_t *sib5; bool sib5_validity;
NR_timer_t sib5_timer; NR_timer_t sib5_timer;
NR_SIB6_t *sib6; bool sib6_validity;
NR_timer_t sib6_timer; NR_timer_t sib6_timer;
NR_SIB7_t *sib7; bool sib7_validity;
NR_timer_t sib7_timer; NR_timer_t sib7_timer;
NR_SIB8_t *sib8; bool sib8_validity;
NR_timer_t sib8_timer; NR_timer_t sib8_timer;
NR_SIB9_t *sib9; bool sib9_validity;
NR_timer_t sib9_timer; NR_timer_t sib9_timer;
NR_SIB10_r16_t *sib10; bool sib10_validity;
NR_timer_t sib10_timer; NR_timer_t sib10_timer;
NR_SIB11_r16_t *sib11; bool sib11_validity;
NR_timer_t sib11_timer; NR_timer_t sib11_timer;
NR_SIB12_r16_t *sib12; bool sib12_validity;
NR_timer_t sib12_timer; NR_timer_t sib12_timer;
NR_SIB13_r16_t *sib13; bool sib13_validity;
NR_timer_t sib13_timer; NR_timer_t sib13_timer;
NR_SIB14_r16_t *sib14; bool sib14_validity;
NR_timer_t sib14_timer; NR_timer_t sib14_timer;
NR_UE_RRC_SI_INFO_r17 SInfo_r17; NR_UE_RRC_SI_INFO_r17 SInfo_r17;
} NR_UE_RRC_SI_INFO; } NR_UE_RRC_SI_INFO;
...@@ -175,6 +175,7 @@ typedef struct NR_UE_Timers_Constants_s { ...@@ -175,6 +175,7 @@ typedef struct NR_UE_Timers_Constants_s {
// constants (limits configured by the network) // constants (limits configured by the network)
uint32_t N310_k; uint32_t N310_k;
uint32_t N311_k; uint32_t N311_k;
NR_UE_TimersAndConstants_t *sib1_TimersAndConstants;
} NR_UE_Timers_Constants_t; } NR_UE_Timers_Constants_t;
typedef enum { typedef enum {
......
...@@ -55,7 +55,7 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc, ...@@ -55,7 +55,7 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc,
void handle_RRCRelease(NR_UE_RRC_INST_t *rrc); void handle_RRCRelease(NR_UE_RRC_INST_t *rrc);
void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t *sib1); void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_UE_TimersAndConstants_t *ue_TimersAndConstants);
/**\brief RRC UE task. /**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */ \param void *args_p Pointer on arguments to start the task. */
......
...@@ -45,80 +45,80 @@ void init_SI_timers(NR_UE_RRC_SI_INFO *SInfo) ...@@ -45,80 +45,80 @@ void init_SI_timers(NR_UE_RRC_SI_INFO *SInfo)
void nr_rrc_SI_timers(NR_UE_RRC_SI_INFO *SInfo) void nr_rrc_SI_timers(NR_UE_RRC_SI_INFO *SInfo)
{ {
if (SInfo->sib1) { if (SInfo->sib1_validity) {
bool sib1_expired = nr_timer_tick(&SInfo->sib1_timer); bool sib1_expired = nr_timer_tick(&SInfo->sib1_timer);
if (sib1_expired) if (sib1_expired)
asn1cFreeStruc(asn_DEF_NR_SIB1, SInfo->sib1); SInfo->sib1_validity = false;
} }
if (SInfo->sib2) { if (SInfo->sib2_validity) {
bool sib2_expired = nr_timer_tick(&SInfo->sib2_timer); bool sib2_expired = nr_timer_tick(&SInfo->sib2_timer);
if (sib2_expired) if (sib2_expired)
asn1cFreeStruc(asn_DEF_NR_SIB2, SInfo->sib2); SInfo->sib2_validity = false;
} }
if (SInfo->sib3) { if (SInfo->sib3_validity) {
bool sib3_expired = nr_timer_tick(&SInfo->sib3_timer); bool sib3_expired = nr_timer_tick(&SInfo->sib3_timer);
if (sib3_expired) if (sib3_expired)
asn1cFreeStruc(asn_DEF_NR_SIB3, SInfo->sib3); SInfo->sib3_validity = false;
} }
if (SInfo->sib4) { if (SInfo->sib4_validity) {
bool sib4_expired = nr_timer_tick(&SInfo->sib4_timer); bool sib4_expired = nr_timer_tick(&SInfo->sib4_timer);
if (sib4_expired) if (sib4_expired)
asn1cFreeStruc(asn_DEF_NR_SIB4, SInfo->sib4); SInfo->sib4_validity = false;
} }
if (SInfo->sib5) { if (SInfo->sib5_validity) {
bool sib5_expired = nr_timer_tick(&SInfo->sib5_timer); bool sib5_expired = nr_timer_tick(&SInfo->sib5_timer);
if (sib5_expired) if (sib5_expired)
asn1cFreeStruc(asn_DEF_NR_SIB5, SInfo->sib5); SInfo->sib5_validity = false;
} }
if (SInfo->sib6) { if (SInfo->sib6_validity) {
bool sib6_expired = nr_timer_tick(&SInfo->sib6_timer); bool sib6_expired = nr_timer_tick(&SInfo->sib6_timer);
if (sib6_expired) if (sib6_expired)
asn1cFreeStruc(asn_DEF_NR_SIB6, SInfo->sib6); SInfo->sib6_validity = false;
} }
if (SInfo->sib7) { if (SInfo->sib7_validity) {
bool sib7_expired = nr_timer_tick(&SInfo->sib7_timer); bool sib7_expired = nr_timer_tick(&SInfo->sib7_timer);
if (sib7_expired) if (sib7_expired)
asn1cFreeStruc(asn_DEF_NR_SIB7, SInfo->sib7); SInfo->sib7_validity = false;
} }
if (SInfo->sib8) { if (SInfo->sib8_validity) {
bool sib8_expired = nr_timer_tick(&SInfo->sib8_timer); bool sib8_expired = nr_timer_tick(&SInfo->sib8_timer);
if (sib8_expired) if (sib8_expired)
asn1cFreeStruc(asn_DEF_NR_SIB8, SInfo->sib8); SInfo->sib8_validity = false;
} }
if (SInfo->sib9) { if (SInfo->sib9_validity) {
bool sib9_expired = nr_timer_tick(&SInfo->sib9_timer); bool sib9_expired = nr_timer_tick(&SInfo->sib9_timer);
if (sib9_expired) if (sib9_expired)
asn1cFreeStruc(asn_DEF_NR_SIB9, SInfo->sib9); SInfo->sib9_validity = false;
} }
if (SInfo->sib10) { if (SInfo->sib10_validity) {
bool sib10_expired = nr_timer_tick(&SInfo->sib10_timer); bool sib10_expired = nr_timer_tick(&SInfo->sib10_timer);
if (sib10_expired) if (sib10_expired)
asn1cFreeStruc(asn_DEF_NR_SIB10_r16, SInfo->sib10); SInfo->sib10_validity = false;
} }
if (SInfo->sib11) { if (SInfo->sib11_validity) {
bool sib11_expired = nr_timer_tick(&SInfo->sib11_timer); bool sib11_expired = nr_timer_tick(&SInfo->sib11_timer);
if (sib11_expired) if (sib11_expired)
asn1cFreeStruc(asn_DEF_NR_SIB11_r16, SInfo->sib11); SInfo->sib11_validity = false;
} }
if (SInfo->sib12) { if (SInfo->sib12_validity) {
bool sib12_expired = nr_timer_tick(&SInfo->sib12_timer); bool sib12_expired = nr_timer_tick(&SInfo->sib12_timer);
if (sib12_expired) if (sib12_expired)
asn1cFreeStruc(asn_DEF_NR_SIB12_r16, SInfo->sib12); SInfo->sib12_validity = false;
} }
if (SInfo->sib13) { if (SInfo->sib13_validity) {
bool sib13_expired = nr_timer_tick(&SInfo->sib13_timer); bool sib13_expired = nr_timer_tick(&SInfo->sib13_timer);
if (sib13_expired) if (sib13_expired)
asn1cFreeStruc(asn_DEF_NR_SIB13_r16, SInfo->sib13); SInfo->sib13_validity = false;
} }
if (SInfo->sib14) { if (SInfo->sib14_validity) {
bool sib14_expired = nr_timer_tick(&SInfo->sib14_timer); bool sib14_expired = nr_timer_tick(&SInfo->sib14_timer);
if (sib14_expired) if (sib14_expired)
asn1cFreeStruc(asn_DEF_NR_SIB14_r16, SInfo->sib14); SInfo->sib14_validity = false;
} }
if (SInfo->SInfo_r17.sib19) { if (SInfo->SInfo_r17.sib19_validity) {
bool sib19_expired = nr_timer_tick(&SInfo->SInfo_r17.sib19_timer); bool sib19_expired = nr_timer_tick(&SInfo->SInfo_r17.sib19_timer);
if (sib19_expired) if (sib19_expired)
asn1cFreeStruc(asn_DEF_NR_SIB19_r17, SInfo->SInfo_r17.sib19); SInfo->SInfo_r17.sib19_validity = false;
} }
} }
...@@ -205,11 +205,11 @@ int nr_rrc_get_T304(long t304) ...@@ -205,11 +205,11 @@ int nr_rrc_get_T304(long t304)
return target; return target;
} }
void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t *sib1) void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_UE_TimersAndConstants_t *ue_TimersAndConstants)
{ {
if(sib1 && sib1->ue_TimersAndConstants) { if(ue_TimersAndConstants) {
int k = 0; int k = 0;
switch (sib1->ue_TimersAndConstants->t301) { switch (ue_TimersAndConstants->t301) {
case NR_UE_TimersAndConstants__t301_ms100 : case NR_UE_TimersAndConstants__t301_ms100 :
k = 100; k = 100;
break; break;
...@@ -235,10 +235,10 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t ...@@ -235,10 +235,10 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t
k = 2000; k = 2000;
break; break;
default : default :
AssertFatal(false, "Invalid T301 %ld\n", sib1->ue_TimersAndConstants->t301); AssertFatal(false, "Invalid T301 %ld\n", ue_TimersAndConstants->t301);
} }
nr_timer_setup(&tac->T301, k, 10); // 10ms step nr_timer_setup(&tac->T301, k, 10); // 10ms step
switch (sib1->ue_TimersAndConstants->t310) { switch (ue_TimersAndConstants->t310) {
case NR_UE_TimersAndConstants__t310_ms0 : case NR_UE_TimersAndConstants__t310_ms0 :
k = 0; k = 0;
break; break;
...@@ -261,10 +261,10 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t ...@@ -261,10 +261,10 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t
k = 2000; k = 2000;
break; break;
default : default :
AssertFatal(false, "Invalid T310 %ld\n", sib1->ue_TimersAndConstants->t310); AssertFatal(false, "Invalid T310 %ld\n", ue_TimersAndConstants->t310);
} }
nr_timer_setup(&tac->T310, k, 10); // 10ms step nr_timer_setup(&tac->T310, k, 10); // 10ms step
switch (sib1->ue_TimersAndConstants->t311) { switch (ue_TimersAndConstants->t311) {
case NR_UE_TimersAndConstants__t311_ms1000 : case NR_UE_TimersAndConstants__t311_ms1000 :
k = 1000; k = 1000;
break; break;
...@@ -287,10 +287,10 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t ...@@ -287,10 +287,10 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t
k = 30000; k = 30000;
break; break;
default : default :
AssertFatal(false, "Invalid T311 %ld\n", sib1->ue_TimersAndConstants->t311); AssertFatal(false, "Invalid T311 %ld\n", ue_TimersAndConstants->t311);
} }
nr_timer_setup(&tac->T311, k, 10); // 10ms step nr_timer_setup(&tac->T311, k, 10); // 10ms step
switch (sib1->ue_TimersAndConstants->n310) { switch (ue_TimersAndConstants->n310) {
case NR_UE_TimersAndConstants__n310_n1 : case NR_UE_TimersAndConstants__n310_n1 :
tac->N310_k = 1; tac->N310_k = 1;
break; break;
...@@ -316,9 +316,9 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t ...@@ -316,9 +316,9 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t
tac->N310_k = 20; tac->N310_k = 20;
break; break;
default : default :
AssertFatal(false, "Invalid N310 %ld\n", sib1->ue_TimersAndConstants->n310); AssertFatal(false, "Invalid N310 %ld\n", ue_TimersAndConstants->n310);
} }
switch (sib1->ue_TimersAndConstants->n311) { switch (ue_TimersAndConstants->n311) {
case NR_UE_TimersAndConstants__n311_n1 : case NR_UE_TimersAndConstants__n311_n1 :
tac->N311_k = 1; tac->N311_k = 1;
break; break;
...@@ -344,16 +344,16 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t ...@@ -344,16 +344,16 @@ void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t
tac->N311_k = 10; tac->N311_k = 10;
break; break;
default : default :
AssertFatal(false, "Invalid N311 %ld\n", sib1->ue_TimersAndConstants->n311); AssertFatal(false, "Invalid N311 %ld\n", ue_TimersAndConstants->n311);
} }
} }
else else
LOG_E(NR_RRC,"SIB1 should not be NULL and neither UE_Timers_Constants\n"); LOG_E(NR_RRC,"UE_Timers_Constants should not be NULL\n");
} }
void nr_rrc_set_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t *sib1) void nr_rrc_set_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t *sib1)
{ {
set_rlf_sib1_timers_and_constants(tac, sib1); set_rlf_sib1_timers_and_constants(tac, sib1->ue_TimersAndConstants);
if(sib1 && sib1->ue_TimersAndConstants) { if(sib1 && sib1->ue_TimersAndConstants) {
int k = 0; int k = 0;
switch (sib1->ue_TimersAndConstants->t300) { switch (sib1->ue_TimersAndConstants->t300) {
...@@ -430,7 +430,7 @@ void nr_rrc_handle_SetupRelease_RLF_TimersAndConstants(NR_UE_RRC_INST_t *rrc, ...@@ -430,7 +430,7 @@ void nr_rrc_handle_SetupRelease_RLF_TimersAndConstants(NR_UE_RRC_INST_t *rrc,
switch(rlf_TimersAndConstants->present){ switch(rlf_TimersAndConstants->present){
case NR_SetupRelease_RLF_TimersAndConstants_PR_release : case NR_SetupRelease_RLF_TimersAndConstants_PR_release :
// use values for timers T301, T310, T311 and constants N310, N311, as included in ue-TimersAndConstants received in SIB1 // use values for timers T301, T310, T311 and constants N310, N311, as included in ue-TimersAndConstants received in SIB1
set_rlf_sib1_timers_and_constants(tac, rrc->perNB[0].SInfo.sib1); set_rlf_sib1_timers_and_constants(tac, rrc->timers_and_constants.sib1_TimersAndConstants);
break; break;
case NR_SetupRelease_RLF_TimersAndConstants_PR_setup : case NR_SetupRelease_RLF_TimersAndConstants_PR_setup :
rlf_tac = rlf_TimersAndConstants->choice.setup; rlf_tac = rlf_TimersAndConstants->choice.setup;
......
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